summaryrefslogtreecommitdiffstats
path: root/g4f/gui/run.py
blob: 0f94814c14ebe5a4204201d6277c1b712961f542 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from argparse import ArgumentParser

from g4f.gui import run_gui


def gui_parser():
    parser = ArgumentParser(description="Run the GUI")
    parser.add_argument("-host", type=str, default="0.0.0.0", help="hostname")
    parser.add_argument("-port", type=int, default=80, help="port")
    parser.add_argument("-debug", action="store_true", help="debug mode")
    return parser


def run_gui_args(args):
    host = args.host
    port = args.port
    debug = args.debug
    run_gui(host, port, debug)


if __name__ == "__main__":
    parser = gui_parser()
    args = parser.parse_args()
    run_gui_args(args)