Comment 2 for bug 1316622

Revision history for this message
Alessandro Molina (alessandro-molina) wrote :

The issue is with subcommands, if you register subcommands in the command_manager based on an option, they won't be listed in the help.

My --expert example was to clearly expose the issue.
Suppose you have a --expert example that enables/disables some subcommands, they will never be listed inside the help (even when --expert is specified) because you never get to initialize_app where the subcommands are added. And you cannot register the subcommands before initialize_app because the option have not been parsed yet and you don't know if --export is true or false yet.

Generally speaking, the issue is that everything you do in initialize_app has not happened yet when the HelpAction is executed (and will actually never happen as the HelpAction does exit(0))