Warn about multiple argument errors at the same time
authorSebastian Pipping <sebastian@pipping.org>
Sun, 26 Jun 2011 01:35:10 +0000 (03:35 +0200)
committerSebastian Pipping <sebastian@pipping.org>
Sun, 26 Jun 2011 01:35:10 +0000 (03:35 +0200)
ChangeLog
modules/catalyst_support.py

index ea5b56779232580daeb9a97ef6919c7752ca3c19..23aa985472c7a0c54eebd1f5b7deaa622cec56eb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,10 @@
 # Distributed under the GPL v2
 # $Id$
 
+  26 Jun 2011; Sebastian Pipping <sping@gentoo.org>
+  modules/catalyst_support.py:
+  Warn about multiple argument errors at the same time
+
   25 Jun 2011; Sebastian Pipping <sping@gentoo.org>
   targets/netboot/netboot-combine.sh, targets/stage1/stage1-chroot.sh,
   targets/stage2/stage2-chroot.sh, targets/support/chroot-functions.sh:
index 12aadc10326c08d7626001e17a6a2f03b22f61c5..39653a428e2381755c6cb3d7919f93746f8302f7 100644 (file)
@@ -676,15 +676,19 @@ def addl_arg_parse(myspec,addlargs,requiredspec,validspec):
        "helper function to help targets parse additional arguments"
        global valid_config_file_values
        
+       messages = []
        for x in addlargs.keys():
                if x not in validspec and x not in valid_config_file_values and x not in requiredspec:
-                       raise CatalystError, "Argument \""+x+"\" not recognized."
+                       messages.append("Argument \""+x+"\" not recognized.")
                else:
                        myspec[x]=addlargs[x]
        
        for x in requiredspec:
                if not myspec.has_key(x):
-                       raise CatalystError, "Required argument \""+x+"\" not specified."
+                       messages.append("Required argument \""+x+"\" not specified.")
+
+       if messages:
+               raise CatalystError, '\n\tAlso: '.join(messages)
        
 def touch(myfile):
        try: