Skip to content

config_handler

appimage_updater.cli.handlers.config_handler

Config command handler for CLI.

ConfigCommandHandler()

Handler for the config command.

Source code in src/appimage_updater/cli/handlers/config_handler.py
def __init__(self) -> None:
    """Initialize the config 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/config_handler.py
def get_command_name(self) -> str:
    """Get the name of this command."""
    return "config"

register_command(app)

Register the config command with the Typer application.

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

    @app.command()
    def config(
        action: str = CLIOptions.CONFIG_ACTION_ARGUMENT,
        setting: str = CLIOptions.CONFIG_SETTING_ARGUMENT,
        value: str = CLIOptions.CONFIG_VALUE_ARGUMENT,
        app_name: str = CLIOptions.CONFIG_APP_NAME_OPTION,
        config_dir: Path = CLIOptions.CONFIG_DIR_OPTION,
        debug: bool = CLIOptions.debug_option(),
        output_format: OutputFormat = CLIOptions.FORMAT_OPTION,
        _version: bool = CLIOptions.version_option(self._version_callback),
    ) -> None:
        """Manage global configuration settings."""
        if not action:
            self._show_config_help()
            raise typer.Exit(0)

        self._execute_config_command(
            action=action,
            setting=setting,
            value=value,
            app_name=app_name,
            config_dir=config_dir,
            debug=debug,
            output_format=output_format,
        )