import argparse
from .client import parse_export_html, run_export_html


def main():
    parser = argparse.ArgumentParser("pycafe-server")
    subparsers = parser.add_subparsers(dest="command", required=True)

    export_parser = subparsers.add_parser(
        "export-html",
        help="Export a directory with an app to a standalone HTML file",
        description="Export a directory with an app to a standalone HTML file",
    )
    parse_export_html(export_parser)

    args = parser.parse_args()
    if args.command == "export-html":
        run_export_html(args)
