changeset 38956:379ae6015366

parser: initialize option values inside namespace
author Dmitry Selyutin <ghostmansd@gmail.com>
date Wed, 13 Sep 2017 18:31:14 +0300
parents 9f70f0e29ef3
children 486dd3aea162
files pygnulib/parser.py
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/pygnulib/parser.py	Wed Sep 13 18:11:31 2017 +0300
+++ b/pygnulib/parser.py	Wed Sep 13 18:31:14 2017 +0300
@@ -91,6 +91,8 @@
                     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_):