-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathargs.py
38 lines (36 loc) · 3.36 KB
/
args.py
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
import argparse
from btdashboard.defaults import default_app_name, \
default_open_browser_delay
def parse_args(**kwargs):
parser = argparse.ArgumentParser(description=default_app_name)
parser.add_argument('--username', '-U', help="Username, if the URL requires authentication")
parser.add_argument('--password', '-P', help="Password, if the URL requires authentication")
parser.add_argument('--lesson-url', '-url', help="The URL for the lesson definition")
parser.add_argument('--static-assets-folder', '-S', help="Explicity specify the folder for static HTML assets")
parser.add_argument('--app-id', '-id', help="Specify the App's Identifier")
parser.add_argument('--app-user', '-iu', help="Specify the App's User")
parser.add_argument('--app-config-file', '-cfa', help="Path to app configuration file")
parser.add_argument('--lessons-config-file', '-cfl', help="Path to lessons configuration file")
parser.add_argument('--dashboard-config-file', '-cfd', help="Path to dashboard configuration file")
parser.add_argument('--sidebar-config-file', '-cfs', help="Path to sidebar configuration file")
parser.add_argument('--cors-origin', '-o', help="Override CORS origin pattern")
parser.add_argument('--logfile-path', '-L', help="Path to logfile")
parser.add_argument('--host-address', '-l', help="Override default host address")
parser.add_argument('--port', '-p', help="Override default listening port")
parser.add_argument('--webterminal-listen-host', '-wlh', help="Override default listening host address for the webterminal socket")
parser.add_argument('--webterminal-listen-port', '-wlp', help="Override default listening port for the webterminal socket")
parser.add_argument('--webterminal-host', '-wh', help="Override the webterminal socket address to which the UI initially connects")
parser.add_argument('--webterminal-shell', '-wS', help="Override default shell for the webterminal session")
parser.add_argument('--webterminal-shell-command', '-wSc', help="Override default shell command for the webterminal session")
parser.add_argument('--open-browser-delay', '-bd', help="Override default time in seconds to delay when opening the system's web browser", default=default_open_browser_delay)
parser.add_argument('--logfile-write-mode', '-w', default='w', choices=['a', 'w'], help="File mode when writing to log file, 'a' to append, 'w' to overwrite")
parser.add_argument('--config-file-templatized', '-fT', action='store_true', default=True, help="Render configuration via jinja2 templating")
parser.add_argument('--api-only', action='store_true', help="Don't serve static assets, only start API")
parser.add_argument('--webterminal-only', action='store_true', help="Don't serve static assets or start API, only invoke Webterminal Websocket")
parser.add_argument('--all-in-one', '-aio', action='store_true', help="Run the shell websocket process alongside app")
parser.add_argument('--no-browser', '-nobrowser', action='store_true', help="If applicable, don't open the web browser")
parser.add_argument('--debug', action='store_true')
parser.add_argument('--no-verify-tls', '-notls',action='store_true', help='Verify SSL cert when downloading web content')
parser.add_argument('--no-render-markdown', '-nomarkdown', action='store_true')
parser.add_argument('run', nargs="?", default=None) # this is just a stub for running via `flask run`
return parser.parse_args()