Friendlier error message on "inprogress" or "open" with no arguments.
authorMarien Zwart <marienz@gentoo.org>
Wed, 5 Apr 2006 21:12:49 +0000 (23:12 +0200)
committerMarien Zwart <marienz@gentoo.org>
Wed, 5 Apr 2006 21:12:49 +0000 (23:12 +0200)
becommands/inprogress.py
becommands/open.py

index 9e396dedfd12da3adb2318d7909b3752f1d1b310..05da971a9ea7668edc4fc65a1ff36b0bbdbd1357 100644 (file)
@@ -30,7 +30,8 @@ def execute(args):
     >>> tests.clean_up()
     """
     options, args = get_parser().parse_args(args)
-    assert(len(args) == 1)
+    if len(args) !=1:
+        raise cmdutil.UserError("Please specify a bug id.")
     bug = cmdutil.get_bug(args[0])
     bug.status = "in-progress"
     bug.save()
index e51bf792fbcc2d788b88b3d6a2ec39c1e6bf7c41..f7c23c19b692090738bb8368cbb696fdf9d28ff1 100644 (file)
@@ -30,7 +30,8 @@ def execute(args):
     >>> tests.clean_up()
     """
     options, args = get_parser().parse_args(args)
-    assert(len(args) == 1)
+    if len(args) !=1:
+        raise cmdutil.UserError("Please specify a bug id.")
     bug = cmdutil.get_bug(args[0])
     bug.status = "open"
     bug.save()