aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorW. Trevor King <wking@tremily.us>2012-09-03 14:26:36 -0400
committerW. Trevor King <wking@tremily.us>2012-09-03 14:32:59 -0400
commit70ba753eebdb6b36db9b6c95555a3bcac2139508 (patch)
tree10d4ca3097f15cf430e2206d156e5bf7b4bad292
parentdaaa79cbe6e07b0a73ddcf5b3bda3fbb724ec122 (diff)
downloadbugseverywhere-70ba753eebdb6b36db9b6c95555a3bcac2139508.tar.gz
ui:command_line: use command names in command-list help message.
The old implementation used module names. For example: command name: import-xml module name: import_xml
-rw-r--r--libbe/ui/command_line.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/libbe/ui/command_line.py b/libbe/ui/command_line.py
index cd28887..b96d278 100644
--- a/libbe/ui/command_line.py
+++ b/libbe/ui/command_line.py
@@ -258,14 +258,14 @@ class BE (libbe.command.Command):
Class = libbe.command.get_command_class(command_name=name)
assert hasattr(Class, '__doc__') and Class.__doc__ != None, \
'Command class %s missing docstring' % Class
- cmdlist.append((name, Class.__doc__.splitlines()[0]))
+ cmdlist.append((Class.name, Class.__doc__.splitlines()[0]))
cmdlist.sort()
longest_cmd_len = max([len(name) for name,desc in cmdlist])
ret = ['Bugs Everywhere - Distributed bug tracking',
'', 'Supported commands']
for name, desc in cmdlist:
numExtraSpaces = longest_cmd_len-len(name)
- ret.append('be %s%*s %s' % (name, numExtraSpaces, '', desc))
+ ret.append('be {}{} {}'.format(name, ' '*numExtraSpaces, desc))
ret.extend(['', 'Run', ' be help [command]', 'for more information.'])
return '\n'.join(ret)