From 68d24277a1fbd47e3e5af21594ed0f3401669b90 Mon Sep 17 00:00:00 2001 From: Aaron Bentley Date: Wed, 18 May 2005 15:29:33 +0000 Subject: [PATCH] Improved command parsing for "new" --- becommands/new.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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 -- 2.26.2