aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbe9
-rw-r--r--becommands/help.py3
-rw-r--r--libbe/cmdutil.py9
3 files changed, 11 insertions, 10 deletions
diff --git a/be b/be
index f4225bd..8ad6a98 100755
--- a/be
+++ b/be
@@ -48,14 +48,7 @@ Unimplemented becommands
if len(sys.argv) == 1 or sys.argv[1] in ('--help', '-h'):
- cmdlist = []
- print """Bugs Everywhere - Distributed bug tracking
-
-Supported commands"""
- for name, module in cmdutil.iter_commands():
- cmdlist.append((name, module.__doc__))
- for name, desc in cmdlist:
- print "be %s\n %s" % (name, desc)
+ print_command_list()
else:
try:
try:
diff --git a/becommands/help.py b/becommands/help.py
index fc89207..cae8949 100644
--- a/becommands/help.py
+++ b/becommands/help.py
@@ -24,8 +24,7 @@ def execute(args):
if len(args) > 1:
raise cmdutil.UserError("Too many arguments.")
if len(args) == 0:
- for name, module in cmdutil.iter_commands():
- print "be %s\n %s" % (name, module.__doc__)
+ print_command_list()
else:
print cmdutil.help(args[0])
return
diff --git a/libbe/cmdutil.py b/libbe/cmdutil.py
index 2f24490..b2c7f8a 100644
--- a/libbe/cmdutil.py
+++ b/libbe/cmdutil.py
@@ -167,6 +167,15 @@ def bug_tree(dir=None):
except bugdir.NoBugDir, e:
raise UserErrorWrap(e)
+def print_command_list():
+ cmdlist = []
+ print """Bugs Everywhere - Distributed bug tracking
+
+Supported commands"""
+ for name, module in iter_commands():
+ cmdlist.append((name, module.__doc__))
+ for name, desc in cmdlist:
+ print "be %s\n %s" % (name, desc)
def _test():
import doctest