]> Savannah Git Hosting - gnulib.git/commitdiff
parser: support empty --lgpl argument
authorDmitry Selyutin <ghostmansd@gmail.com>
Sun, 1 Jul 2018 22:02:30 +0000 (01:02 +0300)
committerDmitry Selyutin <ghostmansd@gmail.com>
Sun, 1 Jul 2018 22:02:30 +0000 (01:02 +0300)
pygnulib/parser.py

index cc99bc53961a259e756fc3a67f201274e4b8ed21..6a80902400e6cff79ab9518d4c8ae18758002cf6 100644 (file)
@@ -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]",
                 }),