]> www.infradead.org Git - users/dhowells/kafs-utils.git/commitdiff
Save raw argument list for each switch
authorDavid Howells <dhowells@redhat.com>
Thu, 10 Apr 2014 10:19:56 +0000 (11:19 +0100)
committerDavid Howells <dhowells@redhat.com>
Thu, 10 Apr 2014 10:19:56 +0000 (11:19 +0100)
Several of the switch parameters have their argument lists cooked by the
argument parser.  This means we cannot get at the original string(s) when
producing error messages.

Save the raw argument list for each switch in the parameters dictionary as a
list of strings attached to a key of "raw.<switchname>".

Signed-off-by: David Howells <dhowells@redhat.com>
suite/argparse.py

index 812f8b1b11a1a677e4dcc97c00052f052f380da9..0e58e666fca16c12d8c9ef1bde61ebeda3ff8945 100644 (file)
@@ -187,6 +187,7 @@ def parse_arguments(args, available_arguments):
 
         # Call the syntax checker
         syntax = match[1]
+        result["raw." + match[0]] = params
         result[match[0]] = syntax(match[0], params)
 
     # Check for missing required arguments