- class tuxemon.cli.clicommand.CLICommand
Base class for CLIOptions.
- description: ClassVar[str] = 'command description'
- example: ClassVar[str] = ''
Return parameters for use by help or autocomplete.
- get_subcommand(ctx, name)
Return a single subcommand by name.
If not implemented by subclass, then this will do a simple search by name of all subcommands as returned by
Return all subcommands of this command.
- invoke(ctx, line)
Called when command input contains this command name as first term.
ctx (InvokeContext) – Contains references to parts of the game and CLI interface.
line (str) – Input text after the command name.
- Return type:
- name: ClassVar[str] = 'command name'
- resolve(ctx, path)
Resolve a path into command and remaining text.
Split the command into tokens.
Starting from the first token, search it for the next token.
If the next token is a subcommand, repeat.
If the next token is not a subcommand, return command and the rest of the input.
- For example:
The string “action npc_face player up” will be parsed by checking each CLICommand for sub commands in a graph search. Starting at the root, which is unnamed, it will have an “action” command. Then searching “action”, it will have “npc_face”. npc_face is a command, but doesn’t have “player” as a subcommand, so the remaining portion of the string will be treated as an argument to “npc_face”.
- usable_from_root: ClassVar[bool] = True