summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Selyutin <ghostmansd@gmail.com>2018-07-02 01:02:30 +0300
committerDmitry Selyutin <ghostmansd@gmail.com>2018-07-02 01:02:30 +0300
commit56d8b43e2aef6886dc824311dd07c78ab7f8b1c0 (patch)
tree4504aecfa05b21e0b8dae46a9dd58177030334a9
parent9ff91f9b80e4eac300ed2f5391f19d0d2e9453ad (diff)
downloadgnulib-56d8b43e2aef6886dc824311dd07c78ab7f8b1c0.tar.gz
parser: support empty --lgpl argument
-rw-r--r--pygnulib/parser.py5
1 files 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]",
}),