From 56d8b43e2aef6886dc824311dd07c78ab7f8b1c0 Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Mon, 2 Jul 2018 01:02:30 +0300 Subject: parser: support empty --lgpl argument --- pygnulib/parser.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pygnulib/parser.py b/pygnulib/parser.py index cc99bc5396..6a80902400 100644 --- a/pygnulib/parser.py +++ b/pygnulib/parser.py @@ -197,12 +197,12 @@ class CommandLine: class _LGPLOption(_Option): def __call__(self, parser, namespace, value, option=None): - if value not in {"2", "3", "yes", "3orGPLv2"}: + if value not in {None, "2", "3", "3orGPLv2"}: parser.error("argument --lgpl: 2, 3, yes or 3orGPLv2") value = { + None: _LGPL_LICENSES, "2": _LGPLv2_LICENSE, "3": _LGPLv3_LICENSE, - "yes": _LGPL_LICENSES, "3orGPLv2": (_GPLv2_LICENSE | _LGPLv3_LICENSE), }[value] super().__call__(parser, namespace, value, option) @@ -715,6 +715,7 @@ class CommandLine: "the default is currently LGPLv3.", ), "action": _LGPLOption, + "nargs": "?", "dest": "licenses", "metavar": "[=2|=3orGPLv2|=3]", }), -- cgit v1.2.1