GridValueCliCommand#
- class wattson.cosimulation.cli.commands.grid_value_cli_command.GridValueCliCommand(cli: CLI)#
Bases:
CliCommandHandler
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.
parse_value
Convert a string representation of truth to true (1) or false (0).
- 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
- 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]
- strtobool(val)#
Convert a string representation of truth to true (1) or false (0). True values are ‘y’, ‘yes’, ‘t’, ‘true’, ‘on’, and ‘1’; false values are ‘n’, ‘no’, ‘f’, ‘false’, ‘off’, and ‘0’. Raises ValueError if ‘val’ is anything else.
- Parameters:
val –