do not show <instance> in help when not needed
This commit is contained in:
parent
3748948b5d
commit
4fb55323e3
10
base.py
10
base.py
@ -83,7 +83,7 @@ class ServiceManager:
|
||||
pkg = ''
|
||||
revcmd = {}
|
||||
USAGE = None
|
||||
main_ins = basename(expanduser('~'))
|
||||
main_ins = None
|
||||
|
||||
def __init__(self):
|
||||
self.env = {}
|
||||
@ -137,7 +137,7 @@ class ServiceManager:
|
||||
for ins in parser.sections():
|
||||
section = dict(parser[ins])
|
||||
if ins == 'MAIN':
|
||||
ins = self.main_ins
|
||||
ins = self.main_ins = basename(expanduser('~'))
|
||||
command = section.get('%s_command' % self.group)
|
||||
self.revcmd[command] = self.group
|
||||
nr = section.get(self.group)
|
||||
@ -410,5 +410,9 @@ class ServiceManager:
|
||||
raise
|
||||
|
||||
def usage(self):
|
||||
print(self.USAGE % ', '.join(self.info))
|
||||
if self.main_ins:
|
||||
usage = self.USAGE.replace(' <instance>', '').replace(' [<instance>]', '') % ''
|
||||
else:
|
||||
usage = self.USAGE % ('<instance> is one of %s' % ', '.join(self.info))
|
||||
print(usage)
|
||||
|
||||
|
@ -36,7 +36,7 @@ class FrappyManager(ServiceManager):
|
||||
frappy stop <instance> [<service>]
|
||||
|
||||
<service> is one of main, stick, addons
|
||||
<instance> is one of %s
|
||||
%s
|
||||
"""
|
||||
|
||||
def prepare_start(self, ins, service):
|
||||
|
@ -65,7 +65,7 @@ class NicosManager(ServiceManager):
|
||||
nicos link <instance> (create links to nicos data and scripts)
|
||||
|
||||
<service> is one of main, stick, addons
|
||||
<instance> is one of %s
|
||||
%s
|
||||
|
||||
to be done after the experiment:
|
||||
nicos copy (copy data and scripts from link)
|
||||
|
@ -51,15 +51,15 @@ class SeaManager(ServiceManager):
|
||||
Usage:
|
||||
|
||||
sea gui <instance>
|
||||
sea <instance> # the same as sea gui <instance>
|
||||
sea cli <instance> (the same as old seacmd)
|
||||
sea start <instance> <service>
|
||||
sea <instance> # the same as sea gui <instance>
|
||||
sea cli <instance> # the same as old seacmd
|
||||
sea start <instance> [<service>]
|
||||
sea restart <instance> [<service>]
|
||||
sea stop <instance> [<service>]
|
||||
sea list [<instance>]
|
||||
|
||||
<service> is one of sea, graph
|
||||
<instance> is one of %s
|
||||
%s
|
||||
"""
|
||||
|
||||
def do_cli(self, ins):
|
||||
|
Loading…
x
Reference in New Issue
Block a user