CliCommandHandler#
- class wattson.cosimulation.cli.cli_command_handler.CliCommandHandler(cli: CLI)#
Bases:
ABC
Methods
Generates a nested dictionary that provides all possible auto complete options.
description
Gets a command divided into a list to apply the respective actions
Returns the help string to be printed in result of a help XY command.
- abstract auto_complete_choices(prefix: List[str], level: int | None = None) dict #
Generates a nested dictionary that provides all possible auto complete options. In case a level is given, the dictionary’s nesting level can be restricted to this level.
- Parameters:
prefix (List[str]) – The command prefix that is relevant for this auto completion
level (Optional[int], optional) – Optional restriction of the maximum nesting level of the dictionary that allows to skip non-static command completions on lower nesting levels (Default value = None)
- Returns:
A nested dictionary with auto complete options. Each dictionary key is a string that contains no spaces
- Return type:
dict
- abstract handle_command(command: List[str], prefix: List[str]) bool #
Gets a command divided into a list to apply the respective actions
- Parameters:
command (List[str]) – The command split into a list at spaces
prefix (List[str]) – The command’s prefix. Original input is ‘prefix command’
- Returns:
True iff the CLI should continue to prompt for the next command
- Return type:
bool
- help(prefix: List[str], subcommand: List[str] | None = None) str | None #
Returns the help string to be printed in result of a help XY command. In case the help-page is requested for a subcommand, the respective command is provided as a list as the first argument
- Parameters:
prefix (List[str]) – The command’s prefix
subcommand (Optional[List[str]], optional) – The optionally requested subcommand (Default value = None)
- Returns:
The help text for the requested command
- Return type:
Optional[str]