From 2066c9cf6e6c16ac0e3a769658b679d56345992c Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Wed, 13 Sep 2017 18:31:14 +0300 Subject: [PATCH] parser: initialize option values inside namespace --- pygnulib/parser.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pygnulib/parser.py b/pygnulib/parser.py index db8513057a..3df79683fc 100644 --- a/pygnulib/parser.py +++ b/pygnulib/parser.py @@ -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_): -- 2.39.5