Skip to content

Commit

Permalink
scripts/ci/gitlab-pipeline-status: refactor parser creation
Browse files Browse the repository at this point in the history
Out of the main function.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
Message-Id: <20200904164258.240278-5-crosa@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
  • Loading branch information
clebergnu authored and huth committed Oct 13, 2020
1 parent db5424d commit 91641d5
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions scripts/ci/gitlab-pipeline-status
Expand Up @@ -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')
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 91641d5

Please sign in to comment.