You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Suppose you have a docstring as follows. Its intent is that the -s|--short option applies only to the info command, while the others apply to all commands:
Usage:
prog --help
prog info [-s|--short] [options]
prog do_thing [options]
Commands:
info Print information
do_thing Do something
Options:
-s, --short Shorter output
-v, --verbose Verbose output
-D, --debug Debug output
-h, --help Print help
This does the Right Thing with respect to the options accepted; prog do_thing --short rejects the option and prints usage information. But the output of prog do_thing --help still includes --short. That seems wrong to me; when I do prog subcommand --help, I expect to see only those options that work with subcommand.
Is this a bug, or intended behavior, or is there something I'm missing?
[edit: this is using docopt v0.6.2]
The text was updated successfully, but these errors were encountered:
This is normal, since options can be intermixed with arguments per default unless you pass options_first=True to docopt. Hence doing prog do_thing --help is equivalent to prog --help do_thing. If you want specific help/usage for subcommands, take a look at the git example.
Suppose you have a docstring as follows. Its intent is that the
-s|--short
option applies only to theinfo
command, while the others apply to all commands:This does the Right Thing with respect to the options accepted;
prog do_thing --short
rejects the option and prints usage information. But the output ofprog do_thing --help
still includes--short
. That seems wrong to me; when I doprog subcommand --help
, I expect to see only those options that work withsubcommand
.Is this a bug, or intended behavior, or is there something I'm missing?
[edit: this is using docopt v0.6.2]
The text was updated successfully, but these errors were encountered: