Skip to content

base

appimage_updater.cli.handlers.base

Base interface for CLI command handlers.

CommandHandler

Base interface for CLI command handlers.

Each command handler is responsible for: 1. Registering its command with the Typer application 2. Parsing CLI arguments and options 3. Executing the command logic 4. Handling errors and output formatting

get_command_name() abstractmethod

Get the name of this command.

Returns:

Type Description
str

The command name (e.g., 'check', 'add', 'list')

Source code in src/appimage_updater/cli/handlers/base.py
@abstractmethod
def get_command_name(self) -> str:
    """Get the name of this command.

    Returns:
        The command name (e.g., 'check', 'add', 'list')
    """

register_command(app) abstractmethod

Register this command with the Typer application.

Parameters:

Name Type Description Default
app Typer

The Typer application instance to register with

required
Source code in src/appimage_updater/cli/handlers/base.py
@abstractmethod
def register_command(self, app: typer.Typer) -> None:
    """Register this command with the Typer application.

    Args:
        app: The Typer application instance to register with
    """

validate_options(**kwargs)

Validate command options and arguments.

Override this method to add custom validation logic. Should raise typer.Exit(1) for validation errors.

Parameters:

Name Type Description Default
**kwargs Any

All command options and arguments

{}
Source code in src/appimage_updater/cli/handlers/base.py
def validate_options(self, **kwargs: Any) -> None:  # noqa: B027
    """Validate command options and arguments.

    Override this method to add custom validation logic.
    Should raise typer.Exit(1) for validation errors.

    Args:
        **kwargs: All command options and arguments
    """
    pass  # Default implementation does nothing