How to enforce docopt to parse one option only? -
folks!
i trying docopt (cpp variant). have tried variant:
usage: prog [-o | --out-file=<out-file>] <in-file> prog -h | --help prog --version options: -h --help show screen. --version show version. -o, --out-file=<out-file> output file name [default: stdout]. <in-file> input file. i expected docopt expects 0 or 1 out-file option , gives me string result, can accept 2 or more options , gives me string-list value.
is right?
i found works expected when corrected command-line description this:
usage: prog [-o<out-file>|--out-file=<out-file>] <in-file> prog -h | --help prog --version options: -h --help show screen. --version show version. -o, --out-file=<out-file> output file name [default: stdout]. <in-file> input file. or this:
usage: prog [-o<out-file>] <in-file> prog -h | --help prog --version options: -h --help show screen. --version show version. -o, --out-file=<out-file> output file name [default: stdout]. <in-file> input file.
Comments
Post a Comment