use required as member variable
authorMoritz Warning <moritzwarning@web.de>
Thu, 20 Aug 2020 09:00:39 +0000 (11:00 +0200)
committerMoritz Warning <moritzwarning@web.de>
Thu, 20 Aug 2020 12:43:02 +0000 (14:43 +0200)
'required' as argument is only available with python 3.7 and later

misc/collect.py

index d5983a0e5f7a9aa7f47d4534e9610ba0cf92e3dc..2307d0cb9e83f9c0aa78db62409dcb07a112a5ee 100755 (executable)
@@ -277,7 +277,8 @@ def main():
     parser.add_argument(
         "--formatted", action="store_true", help="Output formatted JSON data."
     )
-    subparsers = parser.add_subparsers(dest="action", required=True)
+    subparsers = parser.add_subparsers(dest="action")
+    subparsers.required = True
 
     parser_merge = subparsers.add_parser(
         "merge",