Bail out when given an invalid mode.
authorZac Medico <zmedico@gentoo.org>
Fri, 19 Feb 2010 20:33:56 +0000 (20:33 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 19 Feb 2010 20:33:56 +0000 (20:33 -0000)
svn path=/main/trunk/; revision=15394

bin/repoman

index 92f9cc1bf170a2e77dd820c856d559ea9a67dfcf..a67fae8dd1651a6fa5e9242d39cd8174fbfbff19 100755 (executable)
@@ -230,11 +230,13 @@ def ParseArgs(args, qahelp):
        if opts.mode == 'help':
                parser.print_help(short=False)
 
-       for arg in args:
+       for arg in args[1:]:
                if arg in modes:
                        if not opts.mode:
                                opts.mode = arg
                                break
+               else:
+                       parser.error("invalid mode: %s" % arg)
 
        if not opts.mode:
                opts.mode = 'full'