[WIP] improve help message
This commit is contained in:
16
base.py
16
base.py
@@ -487,12 +487,20 @@ class ServiceManager:
|
||||
print(str(e))
|
||||
|
||||
def do_help(self, *args):
|
||||
options = {'ins': '<instance> ', 'optional_ins': '[instance] ', 'remark': '*', 'legend': ''}
|
||||
wildcards = True
|
||||
if self.main_ins:
|
||||
usage = self.USAGE.replace('<instance>', '[instance]') % (
|
||||
'[instance] is empty or one of %s' % ', '.join(self.info))
|
||||
if len(self.info) == 1:
|
||||
for key in options:
|
||||
options[key] = ''
|
||||
wildcards = False
|
||||
else:
|
||||
options['legend'] = ' [instance] is empty or one of %s\n' % ', '.join(self.info)
|
||||
else:
|
||||
usage = self.USAGE % ('<instance> is one of %s' % ', '.join(self.info))
|
||||
print(usage)
|
||||
options['legend'] = ' <instance> is one of %s' % ', '.join(self.info)
|
||||
if wildcards:
|
||||
options['legend'] += " * wildcards allowed, using '.' to replace 0 or more arbitrary characters in <instance>\n"
|
||||
print(self.USAGE % options)
|
||||
|
||||
def treat_args(self, argdict, unknown=(), extra=()):
|
||||
if unknown:
|
||||
|
||||
Reference in New Issue
Block a user