]> Savannah Git Hosting - gnulib.git/commitdiff
parser: initialize option values inside namespace
authorDmitry Selyutin <ghostmansd@gmail.com>
Wed, 13 Sep 2017 15:31:14 +0000 (18:31 +0300)
committerDmitry Selyutin <ghostmansd@gmail.com>
Wed, 13 Sep 2017 17:50:03 +0000 (20:50 +0300)
pygnulib/parser.py

index db8513057a17a6be6da411355916d262cda47336..3df79683fc120d2fc454cdcafb92337283338ad2 100644 (file)
@@ -91,6 +91,8 @@ class CommandLine:
                     mode = "--" + {k:v for (k, v, _) in CommandLine._MODES_}[mode]
                     fmt = "argument {0}: not allowed with {1}"
                     parser.error(fmt.format(mode, option))
+            if self.dest != "mode":
+                setattr(namespace, self.dest, value)
 
 
     class _ConstOption_(_Option_):