I have a Questions: How can one commandset call a command from a other commandset ?
The github discussions may be a better place for this, isn't it?
EDIT: About my Question: I found a way, e.g.:
class FooBarCommandSet(CommandSet):
def do_foo(self, statement: cmd2.Statement = None):
# ... do something ...
# Call a other command from a other CommandSet:
self._cmd.do_foobar(statement=statement)
May fail if the first command get's statement=None but the second needs a Statement instance, isn't it?
EDIT2: This seems to be a better idea:
class FooBarCommandSet(CommandSet):
def do_foo(self, statement: cmd2.Statement = None):
# ... do something ...
# Call a other command from a other CommandSet:
return self._cmd.onecmd_plus_hooks('foobar')
I have a Questions: How can one commandset call a command from a other commandset ?
The github discussions may be a better place for this, isn't it?
EDIT: About my Question: I found a way, e.g.:
May fail if the first command get's
statement=Nonebut the second needs a Statement instance, isn't it?EDIT2: This seems to be a better idea: