click-contrib / click-default-group

Extends click.Group to invoke a command without explicit subcommand name.
BSD 3-Clause "New" or "Revised" License
73 stars 17 forks source link

Default command name not used in help output #11

Closed jcollado closed 5 years ago

jcollado commented 5 years ago

Let's say that I have a command with a default subcommand, when the default subcommand is implicity executed (i.e. subcommand was not typed), whatever value was used as argument is used as the subcommand name in the help string:

$ command does-not-exist -h
Usage: command does-not-exist [OPTIONS]

even if the subcommand wasn't passed, it should be part of the help string:

$ command does-not-exist -h
Usage: command subcommand [OPTIONS]
jcollado commented 5 years ago

@sublee I have added a one-line PR that fixes the problem for me. Please have a look at it and let me know.

sublee commented 5 years ago

@jcollado I approved your PR. Thank you.