lib.Cmd.load_subcommands(): Add method
Push cmds.Cmd._add_subcommands() as lib.Cmd.load_subcommands() one step up to the top of the type hierarchy ladder.
By default, it does the same thing, i.e. load subcommands matching frobnicate.Cmd* if called on class CmdFrobnicate.
This commit also replaces invocations of Cmd._add_subcommands() by invocations of this new method.
Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
8a9e17518b
commit
7e2099877c
8 changed files with 16 additions and 14 deletions
|
|
@ -9,7 +9,7 @@ class CmdPosix(CmdBase): # export
|
|||
|
||||
def __init__(self, parent: App) -> None:
|
||||
super().__init__(parent, 'posix', help='Perform various operations on a distro through its POSIX utility interface')
|
||||
self._add_subcommands()
|
||||
self.load_subcommands()
|
||||
|
||||
def add_arguments(self, p: ArgumentParser) -> None:
|
||||
super().add_arguments(p)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue