spec test index / oilshell.org
| case | dash | bash | mksh | ash | osh | description |
| 0 | pass | pass | pass | pass | pass | getopts empty |
| 1 | pass | pass | pass | pass | pass | getopts sees unknown arg |
| 2 | pass | pass | pass | pass | pass | getopts three invocations |
| 3 | pass | pass | pass | pass | pass | getopts resets OPTARG |
| 4 | pass | pass | pass | pass | pass | Basic getopts invocation |
| 5 | pass | pass | pass | pass | pass | getopts with invalid flag |
| 6 | pass | pass | pass | pass | pass | getopts missing required argument |
| 7 | pass | pass | pass | pass | pass | getopts doesn't look for flags after args |
| 8 | pass | pass | pass | pass | pass | getopts with explicit args |
| 9 | pass | pass | pass | pass | pass | OPTIND |
| 10 | pass | pass | BUG | pass | BUG | OPTIND after multiple getopts with same spec |
| details | details | |||||
| 11 | BUG | pass | BUG | BUG | BUG | OPTIND after multiple getopts with different spec |
| details | details | details | details | |||
| 12 | pass | BUG | BUG | pass | BUG | OPTIND narrowed down |
| details | details | details | ||||
| 13 | pass | pass | pass | pass | pass | Getopts parses the function's arguments |
| 14 | pass | pass | pass | pass | pass | Local OPTIND |
66 passed, 0 ok, 0 known unimplemented, 9 known bugs, 0 failed, 0 skipped
| mksh | 10 OPTIND after multiple getopts with same spec stdout: 1 - - 4 4stderr: _tmp/spec-bin/mksh: <stdin>[13]: getopts: arguments changed since last call |
| osh | 10 OPTIND after multiple getopts with same spec stdout: 1 - - 4 4stderr: |
| dash | 11 OPTIND after multiple getopts with different spec stdout: . 2 - - - 5 _ 2stderr: No arg for -f option |
| mksh | 11 OPTIND after multiple getopts with different spec stdout: . 2 - - 5 5stderr: _tmp/spec-bin/mksh: <stdin>[14]: getopts: arguments changed since last call |
| ash | 11 OPTIND after multiple getopts with different spec stdout: . 2 - - - 5 _ 2stderr: No arg for -f option |
| osh | 11 OPTIND after multiple getopts with different spec stdout: . 2 - - 5 5stderr: |
| bash | 12 OPTIND narrowed down stdout: a=1 b= c= d=1 e=Estderr: |
| mksh | 12 OPTIND narrowed down stdout: a=1 b= c= d=1 e=Estderr: |
| osh | 12 OPTIND narrowed down stdout: a=1 b= c= d=1 e=Estderr: |