-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgeneric_args.py
More file actions
35 lines (28 loc) · 929 Bytes
/
Copy pathgeneric_args.py
File metadata and controls
35 lines (28 loc) · 929 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
"""Args module to enable import of similar arguments into the local
testing scripts.
"""
import argparse
def get_parser(program_name: str, description: str):
"""Return a parser that can be extended."""
parser = argparse.ArgumentParser(
prog=f"{program_name}",
description=description,
epilog="for more information visit https://orcfax.io",
)
parser.add_argument(
"--local",
help="run code locally without ssl",
required=False,
action="store_true",
)
parser.add_argument(
"--secure-local",
help="run code using a local security certificate, local file: `validator.pem`",
required=False,
action="store_true",
)
return parser
def parse_args(program_name: str, description: str):
"""Generic argument parser function."""
parser = get_parser(program_name, description)
return parser.parse_args()