From de884b719cdf8e8efe1b1bebac8b8daf8bd037a4 Mon Sep 17 00:00:00 2001 From: Marcus Huewe Date: Mon, 26 Jul 2010 19:02:48 +0200 Subject: [PATCH] - do_buildlog: show appropriate error msg if too many args are specified --- osc/commandline.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/osc/commandline.py b/osc/commandline.py index b70822a4..bffe39df 100644 --- a/osc/commandline.py +++ b/osc/commandline.py @@ -3365,22 +3365,21 @@ Please submit there instead, or use --nodevelproject to force direct submission. if len(args) == 1 and args[0].startswith('http'): apiurl, project, package, repository, arch = parse_buildlogurl(args[0]) + elif len(args) < 2: + self.print_repos() + elif len(args) > 2: + raise oscerr.WrongArgs('Too many arguments.') else: wd = os.curdir package = store_read_package(wd) project = store_read_project(wd) + repository = args[0] + arch = args[1] offset=0 if opts.start: offset = int(opts.start) - if not repository or not arch: - if len(args) < 2: - self.print_repos() - else: - repository = args[0] - arch = args[1] - print_buildlog(apiurl, project, package, repository, arch, offset)