Created
June 21, 2022 19:34
-
-
Save ryanlong1004/fc3b267af6c9c605e4b0d79b042f87c2 to your computer and use it in GitHub Desktop.
CLI View
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
view.py | |
CLI View layer | |
author: Ryan Long <[email protected]> | |
""" | |
import argparse | |
import pathlib | |
class ViewCLI: | |
"""interfaces user via cli""" | |
@classmethod | |
def get_args(cls): | |
"""get_args display CLI to user and gets options | |
Returns: | |
Namespace: object- | |
""" | |
parser = argparse.ArgumentParser( | |
description="""esmf_branch_summary aggregates esmf framework test results from | |
other branches into a summary file .""" | |
) | |
parser.add_argument( | |
"repo_path", | |
type=pathlib.Path, | |
help="path to esmf-artifacts-merge", | |
) | |
parser.add_argument( | |
"-b", | |
"--branches", | |
nargs="+", | |
help=( | |
"branch(es) to summarize. All by default. " | |
"Example --name develop feature_1 feature_2" | |
), | |
) | |
parser.add_argument( | |
"-n", | |
"--number", | |
type=int, | |
default=1, | |
help=( | |
"number of commits to compile from most recent" "Example --number 10" | |
), | |
) | |
parser.add_argument( | |
"-l", | |
"--log", | |
default="info", | |
help=("Provide logging level. " "Example --log debug', default='info'"), | |
) | |
return parser.parse_args() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment