You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Context.params isn't setup in the MultiCommand.list_commands method #1574
I can refer parsed options in MultiCommand.list_commands method.
Actual Behavior
I can't. Options aren't initialized in the list_commands.
I'm creating a CLI tool that dynamically loads subcommands from a file. And the location of the file is specified by an option of the CLI tool. I can refer the parsed option in MultiCommand.get_command but I can't refer it in MultiCommand.list_commands method.
I think the list_command method is called before finishing the parse_args method so we can't use parsed options in the list_commands.
Could you provide a shorter example that shows where you are calling MultiCommand.list_commands? I have created a example where it is being called late enough for Context.params to be populated:
Activity
parabolize commentedon Aug 31, 2020
Could you provide a shorter example that shows where you are calling
MultiCommand.list_commands? I have created a example where it is being called late enough forContext.paramsto be populated:Output: