nickstenning / honcho

Honcho: a python clone of Foreman. For managing Procfile-based applications.
http://pypi.python.org/pypi/honcho
MIT License
1.59k stars 145 forks source link

[bug] Subparsers override common common_args #215

Closed basepi closed 2 years ago

basepi commented 5 years ago

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.

nickstenning commented 2 years ago

Thank you for reporting! Fixed by ed3fdd2ce2d2b125909256c71cf5d0f8882b7e13.