All commands that do load_subcommands() should have a default _run() implementation which calls print_help(), add them. Signed-off-by: Jan Lindemann <jan@janware.com>
24 lines
585 B
Python
24 lines
585 B
Python
from __future__ import annotations
|
|
|
|
from typing import TYPE_CHECKING
|
|
|
|
from .Cmd import Cmd, Parent
|
|
|
|
if TYPE_CHECKING:
|
|
from argparse import ArgumentParser
|
|
|
|
class CmdPkg(Cmd): # export
|
|
|
|
def __init__(self, parent: Parent) -> None:
|
|
super().__init__(parent, 'pkg', help = 'System package manager wrapper')
|
|
self.load_subcommands()
|
|
|
|
async def _run(self, args):
|
|
import sys
|
|
|
|
# Missing subcommand
|
|
self.parser.print_help()
|
|
sys.exit(1)
|
|
|
|
def add_arguments(self, parser: ArgumentParser) -> None:
|
|
super().add_arguments(parser)
|