Skip to content

add_command

appimage_updater.commands.add_command

Add command implementation.

AddCommand(params)

Command to add a new application to configuration.

Source code in src/appimage_updater/commands/add_command.py
def __init__(self, params: AddParams):
    self.params = params
    self.console = Console()

console = Console() instance-attribute

params = params instance-attribute

execute(output_formatter=None) async

Execute the add command.

Source code in src/appimage_updater/commands/add_command.py
async def execute(self, output_formatter: Any = None) -> CommandResult:
    """Execute the add command."""
    configure_logging(debug=self.params.debug)

    try:
        # Handle special modes first
        special_result = self._handle_special_modes()
        if special_result:
            return special_result

        # Execute main add workflow
        return await self._execute_main_add_workflow(output_formatter)

    except Exception as e:
        return self._handle_execution_error(e)

validate()

Validate command parameters.

Source code in src/appimage_updater/commands/add_command.py
def validate(self) -> list[str]:
    """Validate command parameters."""
    errors: list[str] = []

    # Skip validation for interactive mode or examples
    if self.params.interactive or self.params.examples:
        return errors

    if not self.params.name:
        errors.append("NAME is required")

    if not self.params.url:
        errors.append("URL is required")

    return errors