From 38f665eef8cb2a5afdc23fc73f00ac669d95ac7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Tue, 22 Mar 2011 10:21:25 +0100 Subject: [PATCH] - handle missing or wrong service commands with a valid error --- osc/commandline.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/osc/commandline.py b/osc/commandline.py index 3f9bca7b..a80021d0 100644 --- a/osc/commandline.py +++ b/osc/commandline.py @@ -4858,7 +4858,9 @@ Please submit there instead, or use --nodevelproject to force direct submission. project = package = singleservice = mode = None apiurl = self.get_api_url() - if len(args) < 3: + if len(args) < 1: + raise oscerr.WrongArgs('No command given.') + elif len(args) < 3: if is_package_dir(os.curdir): project = store_read_project(os.curdir) package = store_read_package(os.curdir) @@ -4874,6 +4876,9 @@ Please submit there instead, or use --nodevelproject to force direct submission. command = args[0] + if not (command in ( 'run', 'localrun', 'disabledrun', 'remoterun', 'lr', 'dr', 'r', 'rr' )): + raise oscerr.WrongArgs('Wrong command given.') + if command == "remoterun" or command == "rr": print runservice(apiurl, project, package) return