jw-pkg/src/python/jw/pkg/cmds/CmdDistro.py
Jan Lindemann 18c16917b2 App, .cmds.Cmd: Add .distro property

DistroBase's option --id is now redundant to the new global option --distro-id in the App class, so remove --id. The only added value DistroBase then brings to the table is its .distro property, which can be provided by App just fine at this point, given that App has all it needs to construct a Distro object, so add .distro to App and remove the entire DistroBase class.

For convenience, also make App.distro available as a newly added cmds.Cmd.distro property. This also obviates the need for the distro-related properties in the .distro.Cmd class, remove all that.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-07 14:35:54 +01:00

15 lines
402 B
Python

# -*- coding: utf-8 -*-
from argparse import ArgumentParser
from ..App import App
from .Cmd import Cmd as CmdBase
class CmdDistro(CmdBase): # export
def __init__(self, parent: App) -> None:
super().__init__(parent, 'distro', help="System package manager wrapper")
self._add_subcommands()
def add_arguments(self, p: ArgumentParser) -> None:
super().add_arguments(p)