From 16bb4e5bed2efcb76a0ed8d91eb4282793025329 Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Wed, 15 Apr 2026 09:23:27 +0200 Subject: [PATCH] cmds.CmdPosix: Add command Add a new group of commands - "posix". The current command categories are not a good fit for that: "projects" is for CI, "distro" is distribution-specific for CD, and secrets is for handling secrets specifically. Introduce the more general command group "posix", a class of commands not POSIX compliant in the exposed API, but primarily using POSIX utilities as workhorse. Signed-off-by: Jan Lindemann --- src/python/jw/pkg/cmds/CmdPosix.py | 15 +++++++++++++++ src/python/jw/pkg/cmds/posix/Cmd.py | 18 ++++++++++++++++++ src/python/jw/pkg/cmds/posix/Makefile | 4 ++++ 3 files changed, 37 insertions(+) create mode 100644 src/python/jw/pkg/cmds/CmdPosix.py create mode 100644 src/python/jw/pkg/cmds/posix/Cmd.py create mode 100644 src/python/jw/pkg/cmds/posix/Makefile diff --git a/src/python/jw/pkg/cmds/CmdPosix.py b/src/python/jw/pkg/cmds/CmdPosix.py new file mode 100644 index 00000000..d183cc8c --- /dev/null +++ b/src/python/jw/pkg/cmds/CmdPosix.py @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- + +from argparse import ArgumentParser + +from ..App import App +from .Cmd import Cmd as CmdBase + +class CmdPosix(CmdBase): # export + + def __init__(self, parent: App) -> None: + super().__init__(parent, 'posix', help='Perform various operations on a distro through its POSIX utility interface') + self._add_subcommands() + + def add_arguments(self, p: ArgumentParser) -> None: + super().add_arguments(p) diff --git a/src/python/jw/pkg/cmds/posix/Cmd.py b/src/python/jw/pkg/cmds/posix/Cmd.py new file mode 100644 index 00000000..9939a072 --- /dev/null +++ b/src/python/jw/pkg/cmds/posix/Cmd.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- + +from __future__ import annotations + +from typing import TYPE_CHECKING + +from ..Cmd import Cmd as Base + +if TYPE_CHECKING: + from ..CmdPosix import CmdPosix + +class Cmd(Base): # export + + def __init__(self, parent: CmdPosix, name: str, help: str) -> None: + super().__init__(parent, name, help) + + def add_arguments(self, parser: ArgumentParser) -> None: + super().add_arguments(parser) diff --git a/src/python/jw/pkg/cmds/posix/Makefile b/src/python/jw/pkg/cmds/posix/Makefile new file mode 100644 index 00000000..7a83c333 --- /dev/null +++ b/src/python/jw/pkg/cmds/posix/Makefile @@ -0,0 +1,4 @@ +TOPDIR = ../../../../../.. + +include $(TOPDIR)/make/proj.mk +include $(JWBDIR)/make/py-mod.mk