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:
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
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