[bug] Subparsers override common common_args
basepi opened this issue · comments
Colton Myers commented
Simple way to reproduce this issue:
honcho --no-prefix start # fails, prefixes are present
honcho start --no-prefix # succeeds, prefixes are gone
This is because the common_args are added both to the base parser and to the start subparser. However, they are not namespaced, which means that the default for the subparser arg will override the parser arg even if it's present.
The "correct" fix is to only allow common args before the subcommand. This is also how the --help
reads, so it would match that better. If you wanted to allow common args on either side, I think you'd have to namespace them and combine them after parsing.
Nick Stenning commented
Thank you for reporting! Fixed by ed3fdd2.