2026-05-20 10:54:44 -04:00
|
|
|
import sys
|
2026-05-21 01:01:10 -04:00
|
|
|
from pathlib import Path
|
2026-05-20 10:54:44 -04:00
|
|
|
from xic_shell import xic_cli
|
2026-05-21 01:01:10 -04:00
|
|
|
from xic_executor import run_xic
|
2026-05-20 10:54:44 -04:00
|
|
|
|
|
|
|
|
def main():
|
|
|
|
|
argv = sys.argv[1:]
|
|
|
|
|
if not argv:
|
2026-05-21 01:01:10 -04:00
|
|
|
print("Usage: glyph <command> [options]")
|
|
|
|
|
print(" glyph xic [run|inspect|...] - XIC shell")
|
|
|
|
|
print(" glyph --xic <path> - Run XIC program directly")
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
# Check for --xic flag (direct XIC execution)
|
|
|
|
|
if argv[0] == "--xic":
|
|
|
|
|
if len(argv) < 2:
|
|
|
|
|
print("Usage: glyph --xic <xic_program.gx.json>")
|
|
|
|
|
return
|
|
|
|
|
xic_path = argv[1]
|
|
|
|
|
try:
|
|
|
|
|
run_xic(xic_path, debug=False)
|
|
|
|
|
except Exception as e:
|
|
|
|
|
print(f"Error: {e}")
|
|
|
|
|
sys.exit(1)
|
2026-05-20 10:54:44 -04:00
|
|
|
return
|
|
|
|
|
|
|
|
|
|
cmd = argv[0]
|
|
|
|
|
rest = argv[1:]
|
|
|
|
|
|
|
|
|
|
if cmd == "xic":
|
|
|
|
|
xic_cli(rest)
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
print(f"Unknown command: {cmd}")
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
|
main()
|