From 06c627a8532f5c4531483ffcbeba5ddf724d5685 Mon Sep 17 00:00:00 2001 From: Marien Zwart Date: Wed, 5 Apr 2006 23:05:27 +0200 Subject: Friendlier error message on "close" with no arguments. --- becommands/close.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'becommands') diff --git a/becommands/close.py b/becommands/close.py index 7e5ac1c..52ab735 100644 --- a/becommands/close.py +++ b/becommands/close.py @@ -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 = "closed" bug.save() -- cgit From e312d44cc6967e18b21955c6d9658d4c04259a92 Mon Sep 17 00:00:00 2001 From: Marien Zwart Date: Wed, 5 Apr 2006 23:12:49 +0200 Subject: Friendlier error message on "inprogress" or "open" with no arguments. --- becommands/inprogress.py | 3 ++- becommands/open.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'becommands') diff --git a/becommands/inprogress.py b/becommands/inprogress.py index 9e396de..05da971 100644 --- a/becommands/inprogress.py +++ b/becommands/inprogress.py @@ -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() diff --git a/becommands/open.py b/becommands/open.py index e51bf79..f7c23c1 100644 --- a/becommands/open.py +++ b/becommands/open.py @@ -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() -- cgit