gfw.common.cli.ParametrizedCommand#
- class ParametrizedCommand(name, description='', options=None, run=<function ParametrizedCommand.<lambda>>, **y)[source]#
Command implementation that is fully parameterized via constructor arguments.
The command’s name, description, CLI options, and run behavior are provided when instantiating this class, allowing quick creation of commands without subclassing.
- Parameters:
name (str) – The name of the command (used as a CLI argument).
help – A brief help message describing what the command does.
options (Optional[List[Option]]) – A list of
Optioninstances representing CLI arguments specific to this command.run (Callable[..., Any]) –
Callableexecuted when the command is invoked. It should accept keyword arguments matching the options.
Methods
Returns a new command changing some of its properties.
Returns a dictionary of default values for all CLI options.
Execute the command logic.
Attributes
The command's description.
Returns a descriptive title for the command's options group.
The command's name.
The command's options.