You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/12/28 15:56:14 UTC

[GitHub] [airflow] debodirno commented on a change in pull request #13234: Rewrite handwritten argument parser in prepare_provider_packages.py

debodirno commented on a change in pull request #13234:
URL: https://github.com/apache/airflow/pull/13234#discussion_r549396680



##########
File path: dev/provider_packages/prepare_provider_packages.py
##########
@@ -1532,70 +1506,92 @@ def copy_readme_and_changelog(provider_package_id: str, backport_packages: bool)
     suffix = ""
 
     provider_names = get_provider_packages()
-    possible_first_params = provider_names.copy()
-    possible_first_params.append(LIST_PROVIDERS_PACKAGES)
-    possible_first_params.append(LIST_BACKPORTABLE_PACKAGES)
-    possible_first_params.append(UPDATE_PACKAGE_RELEASE_NOTES)
-    possible_first_params.append(GENERATE_SETUP_FILES)
-    if len(sys.argv) == 1:
-        print(
-            """
-ERROR! Missing first param"
-""",
-            file=sys.stderr,
-        )
-        usage()
-        sys.exit(1)
-    if sys.argv[1] == "--version-suffix":
-        if len(sys.argv) < 3:
-            print(
+    help_text = textwrap.dedent(
+        """
+                Available packages:
+
                 """
-ERROR! --version-suffix needs parameter!
-""",
-                file=sys.stderr,
-            )
-            usage()
-            sys.exit(1)
-        suffix = sys.argv[2]
-        sys.argv = [sys.argv[0]] + sys.argv[3:]
-    elif "--help" in sys.argv or "-h" in sys.argv or len(sys.argv) < 2:
-        usage()
-        sys.exit(0)
+    )
+    out = ""
+    for package in provider_names:
+        out += f"{package} "

Review comment:
       Done.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org