From 9597af801a0d7741f58b20a12b4546786d47ea72 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Thu, 27 May 2010 04:10:14 -0700 Subject: [PATCH] Make parse_opts() bail out when not silent and an option parameter is invalid. --- pym/_emerge/main.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py index fa2dbaa12..9e91ee9e4 100644 --- a/pym/_emerge/main.py +++ b/pym/_emerge/main.py @@ -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 -- 2.26.2