nickstenning / honcho

Honcho: a python clone of Foreman. For managing Procfile-based applications.

Home Page:http://pypi.python.org/pypi/honcho

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[bug] Subparsers override common common_args

basepi opened this issue · comments

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.

Thank you for reporting! Fixed by ed3fdd2.