command¶
command utilities.
Functions
Checks whether the parser had subparsers. |
|
Iterates through the subparsers. |
|
Registers a command to a parent subparser and returns the newly created parser. |
|
Registers the main command entrypoint and returns the parser. |
Classes
Base class for defining commands. |
|
- class Command[source]¶
Bases:
object
Base class for defining commands.
Command instances must implement the
setup()
method, and they should implement theexecute()
method if they perform any functionality beyond defining subparsers.
- class RecursiveHelpAction(option_strings, dest='==SUPPRESS==', default='==SUPPRESS==', help=None)[source]¶
Bases:
_HelpAction
- has_subparsers(parser)[source]¶
Checks whether the parser had subparsers.
- Parameters:
parser (
ArgumentParser
)- Return type:
bool
- Returns:
- iter_subparsers(parser)[source]¶
Iterates through the subparsers.
- Parameters:
parser (
ArgumentParser
)- Returns: