monolith 0.1.0 documentation
Subclass of argparse.ArgumentParser providing more control over output stream.
If completion is enabled, this method would write to self.stdout completion words separated with space.
Runs a command.
Parameters: |
|
---|
Executes command based on given arguments.
Returns commands stored in the registry (sorted by name).
Returns dictionary (name / Command or string pointing at the command class.
Returns monolith.cli.Parser instance for this ExecutionManager.
Returns usage text of the main application parser.
Registers given Command (as given name) at this ExecutionManager‘s registry.
Parameters: |
|
---|---|
Raises AlreadyRegistered: | |
If another command was already registered under given name. |
Base command class that should be subclassed by concrete commands.
Attributes
Returns list of Argument instances for the parser. By default, it returns self.args.
Handles given namespace and executes command. Should be overridden at subclass.
Performs actions once this command is registered within given manager. By default it does nothing.
Command that works on given position arguments (labels). By default, at least one label is required. This is controlled by labels_required attribute.
Extra attributes:
Returns argument for labels.
Handles given namespace by calling handle_label method for each given label.
Handles single label. Should be overridden at subclass.
Performs some action if no lables were given. By default it does nothing.
Command that works on given positional argument (label).
Extra arguments:
Returns argument for label.
Calls handle_label method for given label.
Handles label. Should be overridden at subclass.