import argparse # allow_abbrev=False: "--state" is a prefix of "--state-file", and abbreviation # matching would otherwise silently swallow it into the wrong option. parser = argparse.ArgumentParser(allow_abbrev=False) parser.add_argument("state", nargs="?", default=None, help="State to classify (plain text or JSON). Omit to read --state-file") parser.add_argument("--state-file", type=str, default=None, help="File holding the state (plain text or JSON)") parser.add_argument("--preset", type=str, default=None, help="Named question set from config/classify.py") parser.add_argument("--questions", type=str, default=None, help="JSON file with a questions object, overrides --preset") parser.add_argument("--url", type=str, default=None, help="laya.cpp server base URL, overrides LAYA_URL and config") parser.add_argument("--json", action="store_true", help="Print the raw response envelope as JSON")