main ins no longer needed in command

- MAIN is automatically replaced by the basename of the home directory
- when %(ins) is omitted in *_command, it is also replaced by this
+ add help subcommand
This commit is contained in:
2021-04-09 09:20:10 +02:00
parent 702db45a76
commit 9900af0e3f
2 changed files with 6 additions and 2 deletions

View File

@@ -58,6 +58,9 @@ def run(group, arglist):
managers = {cls.group: cls() for cls in all if cls.group + '_command' in defaults}
serv = managers[group]
arglist = arglist + [''] # add dummy argument
if arglist[0].endswith('help'):
serv.usage()
return
action = arglist.pop(0) if hasattr(serv, 'do_' + arglist[0]) else 'gui'
instance = arglist.pop(0) if arglist[0] and arglist[0] not in serv.services else None
if instance is None and len(serv.info) == 1: