Skip to content

list_command

appimage_updater.commands.list_command

List command implementation.

ListCommand(params)

Command to list applications.

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

console = Console() instance-attribute

params = params instance-attribute

execute(output_formatter=None) async

Execute the list command.

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

    try:
        # Use context manager to make output formatter available throughout the execution
        if output_formatter:
            with OutputFormatterContext(output_formatter):
                success = await self._execute_list_operation()
        else:
            success = await self._execute_list_operation()

        if success:
            return CommandResult(success=True, message="List completed successfully")
        else:
            return CommandResult(success=False, message="Configuration error", exit_code=1)

    except Exception as e:
        logger.error(f"Unexpected error in list command: {e}")
        logger.exception("Full exception details")
        return CommandResult(success=False, message=str(e), exit_code=1)

validate()

Validate command parameters.

Source code in src/appimage_updater/commands/list_command.py
def validate(self) -> list[str]:
    """Validate command parameters."""
    # List command has no required parameters
    return []