import argparse
import logging

import rescriptoon


def main() -> None:
    logging.basicConfig(level=logging.DEBUG)
    argparser = argparse.ArgumentParser(
        description="Attach resriptoon to running Toontown Rewritten engines.",
    )
    argparser.add_argument(
        "--toggle",
        "-t",
        metavar="KEYSYM_NAME",
        dest="toggle_keysym_name",
        default=rescriptoon.EXTENDED_CONTROLS_DEFAULT_TOGGLE_KEYSYM_NAME,
        help="key to turn extended keyboard controls on / off."
        + " any keysym name may be used"
        + " (see XStringToKeysym & X11/keysymdef.h, "
        + " default: %(default)s)",
    )
    args = argparser.parse_args()
    rescriptoon.Overlay(toggle_keysym_name=args.toggle_keysym_name).run()
