30 lines
1.2 KiB
Python
Executable File
30 lines
1.2 KiB
Python
Executable File
import argparse
|
|
|
|
|
|
def build_parser() -> argparse.ArgumentParser:
|
|
parser = argparse.ArgumentParser(
|
|
prog="gx",
|
|
description="GlyphRunner GX compiler and runtime"
|
|
)
|
|
|
|
subparsers = parser.add_subparsers(dest="command", help="Command to run")
|
|
|
|
compile_parser = subparsers.add_parser("compile", help="Compile Python to .gx")
|
|
compile_parser.add_argument("source", help="Source Python file")
|
|
compile_parser.add_argument("-o", "--output", help="Output .gx file")
|
|
|
|
run_parser = subparsers.add_parser("run", help="Execute a .gx file")
|
|
run_parser.add_argument("path", help=".gx file to execute")
|
|
|
|
inspect_parser = subparsers.add_parser("inspect", help="Inspect a .gx file")
|
|
inspect_parser.add_argument("path", help=".gx file to inspect")
|
|
|
|
summary_parser = subparsers.add_parser("summary", help="Show .gx file summary")
|
|
summary_parser.add_argument("path", help=".gx file to summarize")
|
|
|
|
lain_parser = subparsers.add_parser("lain", help="Execute .gx through LAIN runtime")
|
|
lain_parser.add_argument("path", help=".gx file to execute")
|
|
lain_parser.add_argument("-m", "--mode", default="analyze", help="Cognitive mode (default: analyze)")
|
|
|
|
return parser
|