diff options
author | Aaron Bentley <abentley@panoramicfeedback.com> | 2006-04-06 12:54:06 -0400 |
---|---|---|
committer | Aaron Bentley <abentley@panoramicfeedback.com> | 2006-04-06 12:54:06 -0400 |
commit | 1d8631af1d0db514642b9a8f9411559abd73d060 (patch) | |
tree | b7a90513b6d9dc954c7430d18c6a2baa6263758a /becommands/target.py | |
parent | fe4ccf48aa2a2f4f085e2fa828cffa7795db594f (diff) | |
parent | e762576b97dc1c7ccbb7b0d07b94d9d42ec36b9d (diff) | |
download | bugseverywhere-1d8631af1d0db514642b9a8f9411559abd73d060.tar.gz |
Merge from upstream
Diffstat (limited to 'becommands/target.py')
-rw-r--r-- | becommands/target.py | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/becommands/target.py b/becommands/target.py index d077da5..f872abb 100644 --- a/becommands/target.py +++ b/becommands/target.py @@ -25,16 +25,17 @@ def execute(args): >>> import os >>> dir = tests.simple_bug_dir() >>> os.chdir(dir.dir) - >>> execute(("a",)) + >>> execute(["a",]) No target assigned. - >>> execute(("a", "tomorrow")) - >>> execute(("a",)) + >>> execute(["a", "tomorrow"]) + >>> execute(["a",]) tomorrow - >>> execute(("a", "none")) - >>> execute(("a",)) + >>> execute(["a", "none"]) + >>> execute(["a",]) No target assigned. >>> tests.clean_up() """ + options, args = get_parser().parse_args(args) assert(len(args) in (0, 1, 2)) if len(args) == 0: print help() @@ -52,10 +53,11 @@ def execute(args): bug.target = args[1] bug.save() +def get_parser(): + parser = cmdutil.CmdOptionParser("be target bug-id [target]") + return parser -def help(): - return """be target bug-id [target] - +longhelp=""" Show or change a bug's target for fixing. If no target is specified, the current value is printed. If a target @@ -66,3 +68,6 @@ milestone names or release numbers. The value "none" can be used to unset the target. """ + +def help(): + return get_parser().help_str() + longhelp |