Make parse_opts() bail out when not silent and an option parameter is
authorZac Medico <zmedico@gentoo.org>
Thu, 27 May 2010 11:10:14 +0000 (04:10 -0700)
committerZac Medico <zmedico@gentoo.org>
Thu, 27 May 2010 11:10:14 +0000 (04:10 -0700)
invalid.

pym/_emerge/main.py

index fa2dbaa12cf8c7fe15f47686a0a8b8d640f36d4c..9e91ee9e49efe15129d18567f17374561c058c8b 100644 (file)
@@ -806,8 +806,8 @@ def parse_opts(tmpcmdline, silent=False):
                if backtrack < 0:
                        backtrack = None
                        if not silent:
-                               writemsg("!!! Invalid --backtrack parameter: '%s'\n" % \
-                                       (myoptions.backtrack,), noiselevel=-1)
+                               parser.error("Invalid --backtrack parameter: '%s'\n" % \
+                                       (myoptions.backtrack,))
 
                myoptions.backtrack = backtrack
 
@@ -824,8 +824,8 @@ def parse_opts(tmpcmdline, silent=False):
                if deep is not True and deep < 0:
                        deep = None
                        if not silent:
-                               writemsg("!!! Invalid --deep parameter: '%s'\n" % \
-                                       (myoptions.deep,), noiselevel=-1)
+                               parser.error("Invalid --deep parameter: '%s'\n" % \
+                                       (myoptions.deep,))
 
                myoptions.deep = deep
 
@@ -843,8 +843,8 @@ def parse_opts(tmpcmdline, silent=False):
                        jobs < 1:
                        jobs = None
                        if not silent:
-                               writemsg("!!! Invalid --jobs parameter: '%s'\n" % \
-                                       (myoptions.jobs,), noiselevel=-1)
+                               parser.error("Invalid --jobs parameter: '%s'\n" % \
+                                       (myoptions.jobs,))
 
                myoptions.jobs = jobs
 
@@ -857,8 +857,8 @@ def parse_opts(tmpcmdline, silent=False):
                if load_average <= 0.0:
                        load_average = None
                        if not silent:
-                               writemsg("!!! Invalid --load-average parameter: '%s'\n" % \
-                                       (myoptions.load_average,), noiselevel=-1)
+                               parser.error("Invalid --load-average parameter: '%s'\n" % \
+                                       (myoptions.load_average,))
 
                myoptions.load_average = load_average
        
@@ -871,8 +871,8 @@ def parse_opts(tmpcmdline, silent=False):
                if rebuilt_binaries_timestamp < 0:
                        rebuilt_binaries_timestamp = 0
                        if not silent:
-                               writemsg("!!! Invalid --rebuilt-binaries-timestamp parameter: '%s'\n" % \
-                                       (myoptions.rebuilt_binaries_timestamp,), noiselevel=-1)
+                               parser.error("Invalid --rebuilt-binaries-timestamp parameter: '%s'\n" % \
+                                       (myoptions.rebuilt_binaries_timestamp,))
 
                myoptions.rebuilt_binaries_timestamp = rebuilt_binaries_timestamp