mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-31 15:47:26 +00:00
22 lines
583 B
Rust
22 lines
583 B
Rust
use structopt::StructOpt;
|
|
|
|
#[derive(StructOpt)]
|
|
struct Cli {
|
|
#[structopt(name = "path to .60 file", parse(from_os_str))]
|
|
path: std::path::PathBuf,
|
|
}
|
|
|
|
fn main() -> std::io::Result<()> {
|
|
let args = Cli::from_args();
|
|
let source = std::fs::read_to_string(&args.path)?;
|
|
let c = match interpreter::load(source.as_str(), &args.path) {
|
|
Ok(c) => c,
|
|
Err(diag) => {
|
|
diag.print(source);
|
|
std::process::exit(-1);
|
|
}
|
|
};
|
|
|
|
interpreter::instentiate(c, |x| gl::sixtyfps_runtime_run_component_with_gl_renderer(x));
|
|
Ok(())
|
|
}
|