From: Aaron Bentley Date: Wed, 18 May 2005 15:29:33 +0000 (+0000) Subject: Improved command parsing for "new" X-Git-Tag: 1.0.0~289 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=68d24277a1fbd47e3e5af21594ed0f3401669b90;p=be.git Improved command parsing for "new" --- diff --git a/becommands/new.py b/becommands/new.py index 29182ed..df97236 100644 --- a/becommands/new.py +++ b/becommands/new.py @@ -37,6 +37,7 @@ def execute(args): True >>> tests.clean_up() """ + options, args = get_parser().parse_args(args) if len(args) != 1: raise cmdutil.UserError("Please supply a summary message") dir = cmdutil.bug_tree() @@ -46,3 +47,14 @@ def execute(args): bugs = (dir.list()) print "Created bug with ID %s" % cmdutil.unique_name(bug, bugs) +def get_parser(): + parser = cmdutil.CmdOptionParser("be new SUMMARY") + return parser + +longhelp=""" +Create a new bug, with a new ID. The summary specified on the commandline +is a string that describes the bug briefly. +""" + +def help(): + return get_parser().help_str() + longhelp