Skip to content

check_handler

appimage_updater.cli.handlers.check_handler

Check command handler for CLI.

CheckCommandHandler()

Handler for the check command.

Source code in src/appimage_updater/cli/handlers/check_handler.py
def __init__(self) -> None:
    """Initialize the check command handler."""
    self.console = Console()

console = Console() instance-attribute

get_command_name()

Get the name of this command.

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

register_command(app)

Register the check command with the Typer application.

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

    @app.command()
    def check(
        app_names: list[str] = CLIOptions.CHECK_APP_NAME_ARGUMENT,
        config_dir: Path | None = CLIOptions.CONFIG_DIR_OPTION,
        yes: bool = CLIOptions.YES_OPTION,
        no: bool = CLIOptions.NO_OPTION,
        no_interactive: bool = CLIOptions.NO_INTERACTIVE_OPTION,
        verbose: bool = CLIOptions.VERBOSE_OPTION,
        dry_run: bool = CLIOptions.DRY_RUN_OPTION,
        debug: bool = CLIOptions.debug_option(),
        output_format: OutputFormat = CLIOptions.FORMAT_OPTION,
        info: bool = CLIOptions.CHECK_INFO_OPTION,
        instrument_http: bool = CLIOptions.INSTRUMENT_HTTP_OPTION,
        http_stack_depth: int = CLIOptions.HTTP_STACK_DEPTH_OPTION,
        http_track_headers: bool = CLIOptions.HTTP_TRACK_HEADERS_OPTION,
        trace: bool = CLIOptions.TRACE_OPTION,
        _version: bool = CLIOptions.version_option(self._version_callback),
    ) -> None:
        """Check for updates to configured applications.

        Examines each configured application to determine if newer versions are available.
        By default, this command only checks for updates without downloading them.

        Use --yes to automatically download available updates.
        Use --no to perform real checks but automatically decline downloads.
        Use --dry-run to preview what would be checked without making network requests.
        Use --verbose to see detailed parameter resolution and processing information.
        """
        self._execute_check_command(
            app_names=app_names,
            config_dir=config_dir,
            dry_run=dry_run,
            yes=yes,
            no=no,
            no_interactive=no_interactive,
            verbose=verbose,
            debug=debug,
            output_format=output_format,
            info=info,
            instrument_http=instrument_http,
            http_stack_depth=http_stack_depth,
            http_track_headers=http_track_headers,
            trace=trace,
        )

validate_options(**kwargs)

Validate check command options.

Source code in src/appimage_updater/cli/handlers/check_handler.py
def validate_options(self, **kwargs: Any) -> None:
    """Validate check command options."""
    yes = kwargs.get("yes", False)
    no = kwargs.get("no", False)

    if yes and no:
        self.console.print("[red]Error: --yes and --no options are mutually exclusive")
        raise typer.Exit(1)