diff --git a/src/python/jw/pkg/cmds/Cmd.py b/src/python/jw/pkg/cmds/Cmd.py index 49364839..783886ae 100644 --- a/src/python/jw/pkg/cmds/Cmd.py +++ b/src/python/jw/pkg/cmds/Cmd.py @@ -14,9 +14,7 @@ class Cmd(Base): # export super().__init__(parent, name, help) def _add_subcommands(self) -> None: - self.add_subcommands( - LoadTypes( - [__name__.rsplit('.', 1)[0] + '.' + self.name], - type_name_filter=r'Cmd[^.]' - ) - ) + # Derive module search path for the calling module's subcommands from + # the module path of the calling module itself + cmds_module = type(self).__module__.replace('Cmd', '').lower() + self.add_subcommands(LoadTypes([cmds_module], type_name_filter=r'Cmd[^.]'))