mini_arcade.cli.base_command¶
Base command module This module defines the BaseCommand class, which serves as a base for all command implementations.
Classes¶
Base class for all commands. |
Module Contents¶
- class mini_arcade.cli.base_command.BaseCommand[source]¶
Bases:
abc.ABCBase class for all commands.
Registration is done via the implementation decorator:
@CommandRegistry.implementation(“build”) class Build(BaseCommand): …
or:
from .command_registry import CommandRegistry @CommandRegistry.implementation(“build”) class Build(BaseCommand): …
Subclasses should implement the execute(…) method as the main entrypoint.
- Variables:
name – Optional[str]: Command name (for registry); defaults to class name lowercased.
aliases – Tuple[str, …]: Optional command aliases.
summary – Optional[str]: Short description of the command.
epilog – Optional[str]: Additional help text for the command.
args – Optional[List[ArgumentType]]: List of command arguments.
abstract – bool: If True, the command is not registered (base class for shared logic); defaults to False.
processor – Optional[BaseCommandProcessor]: The processor associated with this command.
- name: str | None = None¶
- aliases: Tuple[str, Ellipsis] = ()¶
- summary: str | None = None¶
- epilog: str | None = None¶
- args: List[mini_arcade.cli.argument_type.ArgumentType] | None = None¶
- abstract: bool = False¶
- processor: mini_arcade.cli.base_command_processor.BaseCommandProcessor | None = None¶
- classmethod define_arguments() List[mini_arcade.cli.argument_type.ArgumentType][source]¶
Return the list of ArgumentType for this command.
- Returns:
List of ArgumentType instances.
- Return type:
List[ArgumentType]
- set_processor(processor: mini_arcade.cli.base_command_processor.BaseCommandProcessor)[source]¶
Set the processor for the command.
- Parameters:
processor (BaseCommandProcessor) – The processor for the command.