mirror of
ssh://git.janware.com/janware/proj/jw-pkg
synced 2026-04-24 17:23:36 +02:00
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 <jan@janware.com>
This commit is contained in:
parent
63383cb683
commit
16bb4e5bed
3 changed files with 37 additions and 0 deletions
15
src/python/jw/pkg/cmds/CmdPosix.py
Normal file
15
src/python/jw/pkg/cmds/CmdPosix.py
Normal file
|
|
@ -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)
|
||||||
18
src/python/jw/pkg/cmds/posix/Cmd.py
Normal file
18
src/python/jw/pkg/cmds/posix/Cmd.py
Normal file
|
|
@ -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)
|
||||||
4
src/python/jw/pkg/cmds/posix/Makefile
Normal file
4
src/python/jw/pkg/cmds/posix/Makefile
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
TOPDIR = ../../../../../..
|
||||||
|
|
||||||
|
include $(TOPDIR)/make/proj.mk
|
||||||
|
include $(JWBDIR)/make/py-mod.mk
|
||||||
Loading…
Add table
Add a link
Reference in a new issue