-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathcli_utils.py
More file actions
39 lines (30 loc) · 926 Bytes
/
cli_utils.py
File metadata and controls
39 lines (30 loc) · 926 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
36
37
38
39
"""CLI utils module."""
import argparse
import fourc_webviewer.run_webserver as webserver
def main():
"""Get the CLI arguments and start the webviewer."""
arguments = get_arguments()
webserver.run_webviewer(**arguments)
def get_arguments():
"""Get the CLI arguments.
Returns:
dict: Arguments dictionary
"""
parser = argparse.ArgumentParser(description="4C Webviewer")
parser.add_argument(
"--port",
type=int,
default=12345,
help="port to start the app on",
)
parser.add_argument(
"--fourc_yaml_file", type=str, help="input file path to visualize"
)
parser.add_argument(
"--server",
action="store_true",
help="start app in server mode without opening the browser (useful for local port forwarding via ssh)",
)
args = parser.parse_args()
# return arguments as dict
return vars(args)