diff options
author | W. Trevor King <wking@tremily.us> | 2012-09-03 15:18:22 -0400 |
---|---|---|
committer | W. Trevor King <wking@tremily.us> | 2012-09-03 15:18:22 -0400 |
commit | a9ab97020028ff294001b333e51349eef1579666 (patch) | |
tree | ffda39417dc6c2482fa8429bbb7f6f14835d7f7a /libbe | |
parent | b5cbf7b2ac05efcfd40e6d791f13ceda459536b3 (diff) | |
download | bugseverywhere-a9ab97020028ff294001b333e51349eef1579666.tar.gz |
ui:command_line: display help.TOPICS during `be help`.
Diffstat (limited to 'libbe')
-rw-r--r-- | libbe/ui/command_line.py | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/libbe/ui/command_line.py b/libbe/ui/command_line.py index b96d278..b95972f 100644 --- a/libbe/ui/command_line.py +++ b/libbe/ui/command_line.py @@ -27,6 +27,7 @@ import sys import libbe import libbe.bugdir import libbe.command +import libbe.command.help import libbe.command.util import libbe.storage import libbe.version @@ -262,11 +263,22 @@ class BE (libbe.command.Command): cmdlist.sort() longest_cmd_len = max([len(name) for name,desc in cmdlist]) ret = ['Bugs Everywhere - Distributed bug tracking', - '', 'Supported commands'] + '', 'Commands:'] for name, desc in cmdlist: numExtraSpaces = longest_cmd_len-len(name) ret.append('be {}{} {}'.format(name, ' '*numExtraSpaces, desc)) - ret.extend(['', 'Run', ' be help [command]', 'for more information.']) + + ret.extend(['', 'Topics:']) + topic_list = [ + (name,desc.splitlines()[0]) + for name,desc in sorted(libbe.command.help.TOPICS.items())] + longest_topic_len = max([len(name) for name,desc in topic_list]) + for name,desc in topic_list: + extra_spaces = longest_topic_len - len(name) + ret.append('{}{} {}'.format(name, ' '*extra_spaces, desc)) + + ret.extend(['', 'Run', ' be help [command|topic]', + 'for more information.']) return '\n'.join(ret) def version(self, *args): |