class documentation

class CommandCollection(MultiCommand):

View In Hierarchy

A command collection is a multi command that merges multiple multi commands together into one. This is a straightforward implementation that accepts a list of different multi commands as sources and provides all the commands for each of them.
Method __init__ Undocumented
Method add​_source Adds a new multi command to the chain dispatcher.
Method get​_command Given a context and a command name, this returns a Command object if it exists or returns None.
Method list​_commands Returns a list of subcommand names in the order they should appear.
Instance Variable sources 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
def __init__(self, name=None, sources=None, **attrs):

Undocumented

Parameters
name:t.Optional[str]Undocumented
sources:t.Optional[t.List[MultiCommand]]Undocumented
**attrs:t.AnyUndocumented
def add_source(self, multi_cmd):
Adds a new multi command to the chain dispatcher.
Parameters
multi​_cmd:MultiCommandUndocumented
def get_command(self, ctx, cmd_name):
Given a context and a command name, this returns a Command object if it exists or returns None.
Parameters
ctx:ContextUndocumented
cmd​_name:strUndocumented
Returns
t.Optional[Command]Undocumented
def list_commands(self, ctx):
Returns a list of subcommand names in the order they should appear.
Parameters
ctx:ContextUndocumented
Returns
t.List[str]Undocumented
sources: t.List[MultiCommand] =

Undocumented