Usage:
program defintion
Options:
<this area>
- short option
- ✓
-o - ✓
-o ARG - ✓
-o <arg> - ✓
-o ARG... - ✓
-o <arg>...
- ✓
- long option
- ✓
--option - ✓
--option ARG - ✓
--option=ARG - ✓
--option <arg> - ✓
--option=<arg> - ✓
--option ARG... - ✓
--option <arg>... - ✓
--option=ARG... - ✓
--option=<arg>...
- ✓
- option with default value
- ✓
[default: value] - ✓
Option description. [default: value]
- ✓
- comma between short and long options
- ✓
-o, --option - ✓
-o ARG, --option - ✓
-o <arg>, --option - ✓
-o ARG..., --option - ✓
-o <arg>..., --option
- ✓
- not necessary to define
ARG/<arg>for both short and long option- ✓
-o ARG --option - ✓
-o --option ARG - ✓
-o ARG... --option - ✓
-o --option ARG...
- ✓
Usage:
<this area>
Options:
options definition
- short option
- ✓
-o - ✓
-o ARG - ✓
-o <arg> - ✗
-o WRONG_ARGthrow error if there is mismatch in naming of arguments declared in options area. - ✓
-owithoutARGbut it is declared in options that it takes an argument. - ✓
-v...continous option. - ✓
-o ARG... - ✓
-o <arg>... - ✗
-v...throw error if it declared in options that it takes an argument. - ✓
-abcconsecutive short options with a single dash .
- ✓
- long option
- ✓
--option - ✓
--option ARG - ✓
--option=ARG - ✓
--option <arg> - ✓
--option=<arg> - ✓
--optionwithoutARGit is declared in options that it takes an argument. - ✗
--option WRONG_ARGthrow error if there is mismatch in naming of arguments declared in options area. - ✓
--verbose...continous option - ✓
--option ARG... - ✓
--option=ARG... - ✓
--option <arg>... - ✓
--option=<arg>... - ✗
--verbose...throw error if it declared in options that it takes an argument.
- ✓
- optional options
- ✓
[-o] - ✓
[-o ARG] - ✓
[-o ARG...] - ✓
[-o <arg>] - ✓
[--option] - ✓
[--option ARG] - ✓
[--option=ARG] - ✓
[--option <arg>] - ✓
[--option=<arg>] - ✓
[-o <arg>...] - ✓
[--option ARG...] - ✓
[--option=ARG...] - ✓
[--option <arg>...] - ✓
[--option=<arg>...] - ✓
[options]special "all options" allowed in no particular order.
- ✓
- commands
- ✓
command - ✓
command... - ✓
[command]optional command. - ✓
[command...]optional continous command.
- ✓
- positional argument
- ✓
ARG - ✓
ARG...continous argument resolves to multiple values. - ✓
ARG ARG...singular and plural definition resolves to multiple values.
- ✓
- multiple optionals
- ✓
[--input --output]multiple long options inside a single pair of brackets. - ✓
[-i -o]multiple short options inside a single pair of brackets. - ✓
[-io]consecutiave short options. - ✓
[FILE1 FILE2]positional arguments.
- ✓
- grouping
- ✓
--option1 | --option2 | --option3 ... - ✓
command1 | command2 | command3 ... - ✓
(--input --ouput | --in --out)multiple required pairs
- ✓
declare -A ARGS=(
...this area
)
_docopt ()(...)- short option
- ✓
-oshort option without long counterpart resolves to short name with-prefix. - ✓ Defaults to false when no argument is declared.
- ✓ Defatuls to empty
-o=when argument is declared without a default. - ✓
[-i FILE] [default: -]Defaults declared default value.
- ✓
- long option
- ✓
--optionlong option resolves to name with--prefix. - ✓ Defaults to false.
- ✓ Defatuls to empty
--option=when argument is declared without a default. - ✓
[--input FILE] [default: -]Defaults to declared default value.
- ✓
- short and long
- ✓
-o --optionresolves to long name with--prefix.
- ✓
- command
- ✓
commandDefaults tofalseon singular value. - ✓
command...Defaults to0on continous values.
- ✓
- positional
- ✓
ARGDefaults to emptyARG=on singular value. - ✓
ARG...Defaults to emptyARG=on continous values.
- ✓
$ program <this area>- ✓ empty program
- option
- ✓
--optionmatch required without argument. - ✓
--option=ARGmatch required with argument. - ✓
--match provided optional wihout argument. - ✓ match provided optional with argument.
- ✓ match non-provided optional wihout argument.
- ✓ match non-provided optional with argument.
- ✗ error on non-exiting option.
- ✓
- command
- ✓ match required singular.
- ✓ match required continous.
- ✓ match provided optional singular.
- ✓ match provided optional continous.
- ✓ match non-provided optional singular.
- ✓ match non-provided optional continous.
- ✗ error on non-exiting command.
- positional
- ✓
ARGmatch required singular. - ✓
ARG...match required continous. - ✓
[ARG]match provided optional singular. - ✓
[ARG...]match provided optional continous. - ✓
[ARG]match non-provided optional singular. - ✓
[ARG...]match non-provided optional continous. - ✗ error when required not met.
- ✓