-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Description
Expected Behavior
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.
Line 1242 in fef921a
| echo(ctx.get_help(), color=ctx.color) |
Line 1217 in fef921a
| for subcommand in self.list_commands(ctx): |
I created the following file and I got an empty dictionary object by the logger.debug when I execute the following command.
https://github.com/polikeiji/bkm/blob/master/bkm.py#L94
python -m bkm -f AAA --help
Is this behavior the expected one?
Environment
- Python version: 3.8.0
- Click version: 7.1.2