mod app; mod cli; mod interpreter; mod renderer; use clap::{Parser, Subcommand}; #[derive(Debug, Clone)] pub enum Message { EventTriggered(String), InputChanged(Option, String), ToggleChanged(Option, bool), SliderChanged(Option, f64), WindowScrolled(f32), } #[derive(Parser)] #[command(name = "glint-runtime")] #[command(author, version, about = "Glint runtime – compile and run .gltm/.glts files", long_about = None)] struct Cli { #[command(subcommand)] command: Commands, } #[derive(Subcommand)] enum Commands { Compile { #[arg(required = true)] gltm_files: Vec, #[arg(short = 's', long = "style")] glts_files: Vec, #[arg(short = 'o', long = "output")] output: Option, }, Run { /// Bytecode file to execute file: String, }, } fn main() { let cli = Cli::parse(); match cli.command { Commands::Compile { gltm_files, glts_files, output, } => { let output_path = output.unwrap_or_else(|| { std::path::Path::new(&gltm_files[0]) .with_extension("glbc") .to_string_lossy() .to_string() }); cli::compile_files(&gltm_files, &glts_files, &output_path); } Commands::Run { file } => { cli::run_file(&file); } } }