]> Git Repo - qemu.git/commitdiff
scripts/ci/gitlab-pipeline-status: refactor parser creation
authorCleber Rosa <[email protected]>
Fri, 4 Sep 2020 16:42:55 +0000 (12:42 -0400)
committerThomas Huth <[email protected]>
Tue, 13 Oct 2020 10:48:17 +0000 (12:48 +0200)
Out of the main function.

Signed-off-by: Cleber Rosa <[email protected]>
Message-Id: <20200904164258[email protected]>
Signed-off-by: Thomas Huth <[email protected]>
scripts/ci/gitlab-pipeline-status

index 18609553be8a53a7d858faefe1d84147602340f8..8355b6a427e6c094398e21d89bd04103fd8f174a 100755 (executable)
@@ -89,10 +89,7 @@ def wait_on_pipeline_success(timeout, interval,
         return False
 
 
-def main():
-    """
-    Script entry point
-    """
+def create_parser():
     parser = argparse.ArgumentParser(
         prog='pipeline-status',
         description='check or wait on a pipeline status')
@@ -127,7 +124,13 @@ def main():
     parser.add_argument('--verbose', action='store_true', default=False,
                         help=('A minimal verbosity level that prints the '
                               'overall result of the check/wait'))
+    return parser
 
+def main():
+    """
+    Script entry point
+    """
+    parser = create_parser()
     args = parser.parse_args()
 
     try:
This page took 0.025186 seconds and 4 git commands to generate.