cmds.xxx .CmdXxx._run(): Add print_help()

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>
This commit is contained in:
Jan Lindemann 2026-06-02 10:08:49 +02:00
commit d0621f5c57
Signed by: Jan Lindemann
GPG key ID: 3750640C9E25DD61
7 changed files with 46 additions and 13 deletions

View file

@ -20,5 +20,12 @@ class CmdPosix(Cmd): # export
)
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)