initialize_app is not called when running --help
Bug #1316622 reported by
Alessandro Molina
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cliff |
Fix Released
|
Wishlist
|
Cedric Brandily |
Bug Description
If subclasses added sub-commands during App.initialize_app hook, they are correctly available when called but are not listed when running "--help".
This is because parser.
In case sub-commands might depend on some parser options (for example be available only with --expert option) they have to be registered during initialize_app when self.options is available. This causes that those commands are never listed in the help.
Would it make sense to avoid using "action=HelpAction" and actually handle the help in App.run so that it is part of the standard application flow?
Changed in python-cliff: | |
importance: | Undecided → Wishlist |
status: | New → Triaged |
Changed in python-cliff: | |
assignee: | nobody → Cedric Brandily (cbrandily) |
Changed in python-cliff: | |
milestone: | none → 1.10.0 |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
Options added by overriding build_option_ parser( ) will appear in the help output. It looks like that's not in the tutorial, so we need to update the docs.
I'm not sure I follow the use case for an expert mode flag. That turns on options that aren't otherwise available? Why?