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:
parent
6874a90bb4
commit
d0621f5c57
7 changed files with 46 additions and 13 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue