Bail out when given an invalid mode. (trunk r15394)
authorZac Medico <zmedico@gentoo.org>
Tue, 2 Mar 2010 20:38:22 +0000 (20:38 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 2 Mar 2010 20:38:22 +0000 (20:38 -0000)
svn path=/main/branches/2.1.7/; revision=15616

bin/repoman

index 38b06d3340308d412f66c194f753c1a1c08c7db7..3e770919cb06c88f88b39c2083ac6101e79f834b 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'