jwutils.Cmds: Cmd.add_subcommands() fails for multiple commands

jwutils.Cmd.add_subcommands() had two issues. First, it failed for
more than one command, and with that fixed, it only added the first
command of a list of commands passed as an argument. This commit
fixes both issues and leaves some logging and cleanup in place, which
was used during debugging.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2020-04-07 09:23:13 +02:00
commit 33d3b7a7b3
2 changed files with 28 additions and 22 deletions

View file

@ -35,7 +35,7 @@ class Cmd(ABC): # export
if isinstance(cmd, list):
for c in cmd:
self.add_subcommands(c)
return
return
self.child_classes.append(cmd)
def add_arguments(self, parser):