An error that should be raised from within the command.
A command line runner that allows new commands to be added and run on demand.
Commands can be added either as a fully qualified name, or imported.
runner = Runner(commands=['module.commands.ACommand']) runner()
Convenience method to add new commands after the runner has been initialized.
Parameters: command (string|class) – the command to add
Convenience method to add multiple commands.
Parameters: commands (list|tuple) – the commands to add
Register the commands against the parser.
- parser – The parser to add commands to
- namespace – The namespace the commands should sit within
A list of all commands added to the runner.
Returns: OrderedDict containing all the commands.
Execute the runner and any commands the user has specified.
Returns an initialized command from the attached commands.
Parameters: command_name – The command name to retrieve
Returns the name of the script that runner was executed from.
update_usage(parser, namespace, is_subparser=False)¶
Updates the usage for the relevant parser.
Forces the usage message to include the namespace and color.