def main():
    options = load_config()

    parser = argparse.ArgumentParser(prog="gdanmaku")
    parser.add_argument(
        "--server",
        type=str,
        default=options["http_stream_server"],
        help="danmaku stream server"
    )

    parser.add_argument(
        '--config',
        action="store_true",
        help="run configuration window"
    )

    args = parser.parse_args()

    signal.signal(signal.SIGINT, signal.SIG_DFL)
    signal.signal(signal.SIGTERM, signal.SIG_DFL)

    if args.config:
        app_config()
    else:
        main_app = Main(args.server)
        main_app.run()