class Group(MultiCommand):
A group allows a command to have subcommands attached. This is the most common way to implement nesting in Click.
Parameters | |
name | The name of the group command. |
commands | A dict mapping names to Command objects.
Can also be a list of Command , which will use
Command.name to create the dict. |
**attrs | Other command arguments described in
MultiCommand , Command , and
BaseCommand . |
Method | __init__ |
Undocumented |
Method | add_command |
Registers another Command with this group. If the name is not provided, the name of the command is used. |
Method | command |
No summary |
Method | get_command |
Given a context and a command name, this returns a Command object if it exists or returns None . |
Method | group |
No summary |
Method | list_commands |
Returns a list of subcommand names in the order they should appear. |
Class Variable | command_class |
Undocumented |
Class Variable | group_class |
Undocumented |
Instance Variable | commands |
Undocumented |
Inherited from MultiCommand
:
Method | collect_usage_pieces |
Returns all the pieces that go into the usage line and returns it as a list of strings. |
Method | format_commands |
Extra format methods for multi methods that adds all the commands after the options. |
Method | format_options |
Writes all the options into the formatter if they exist. |
Method | invoke |
Given a context, this invokes the attached callback (if it exists) in the right way. |
Method | parse_args |
Given a context and a list of arguments this creates the parser and parses the arguments, then modifies the context as necessary. This is automatically invoked by make_context . |
Method | resolve_command |
Undocumented |
Method | result_callback |
No summary |
Method | resultcallback |
Undocumented |
Method | shell_complete |
Return a list of completions for the incomplete value. Looks at the names of options, subcommands, and chained multi-commands. |
Method | to_info_dict |
Gather information that could be useful for a tool generating user-facing documentation. This traverses the entire structure below this command. |
Class Variable | allow_extra_args |
Undocumented |
Class Variable | allow_interspersed_args |
Undocumented |
Instance Variable | _result_callback |
Undocumented |
Instance Variable | chain |
Undocumented |
Instance Variable | invoke_without_command |
Undocumented |
Instance Variable | no_args_is_help |
Undocumented |
Instance Variable | subcommand_metavar |
Undocumented |
Inherited from Command
(via MultiCommand
):
Method | format_epilog |
Writes the epilog into the formatter if it exists. |
Method | format_help |
Writes the help into the formatter if it exists. |
Method | format_help_text |
Writes the help text to the formatter if it exists. |
Method | format_usage |
Writes the usage line into the formatter. |
Method | get_help |
Formats the help into a string and returns it. |
Method | get_help_option |
Returns the help option object. |
Method | get_help_option_names |
Returns the names for the help option. |
Method | get_params |
Undocumented |
Method | get_short_help_str |
Gets short help for the command or makes it by shortening the long help string. |
Method | get_usage |
Formats the usage line into a string and returns it. |
Method | make_parser |
Creates the underlying option parser for this command. |
Instance Variable | add_help_option |
Undocumented |
Instance Variable | callback |
Undocumented |
Instance Variable | deprecated |
Undocumented |
Instance Variable | epilog |
Undocumented |
Instance Variable | help |
Undocumented |
Instance Variable | hidden |
Undocumented |
Instance Variable | options_metavar |
Undocumented |
Instance Variable | params |
Undocumented |
Instance Variable | short_help |
Undocumented |
Inherited from BaseCommand
(via MultiCommand
, Command
):
Method | __call__ |
Alias for main . |
Method | __repr__ |
Undocumented |
Method | _main_shell_completion |
Check if the shell is asking for tab completion, process that, then exit early. Called from main before the program is invoked. |
Method | main |
No summary |
Method | make_context |
This function when given an info name and arguments will kick off the parsing and create a new Context . It does not invoke the actual command callback though. |
Class Variable | ignore_unknown_options |
Undocumented |
Instance Variable | context_settings |
Undocumented |
Instance Variable | name |
Undocumented |
A shortcut decorator for declaring and attaching a command to
the group. This takes the same arguments as command
and
immediately registers the created command with this group by
calling add_command
.
To customize the command class used, set the
command_class
attribute.
command_class
attribute.Parameters | |
*args:t.Any | Undocumented |
**kwargs:t.Any | Undocumented |
Returns | |
t.Callable[ | Undocumented |
A shortcut decorator for declaring and attaching a group to
the group. This takes the same arguments as group
and
immediately registers the created group with this group by
calling add_command
.
To customize the group class used, set the group_class
attribute.
group_class
attribute.Parameters | |
*args:t.Any | Undocumented |
**kwargs:t.Any | Undocumented |
Returns | |
t.Callable[ | Undocumented |
click.core.MultiCommand.list_commands
Parameters | |
ctx:Context | Undocumented |
Returns | |
t.List[ | Undocumented |