Files
modeling-app/rust/kcl-to-core/src/tool.rs
Adam Chalmers 4356885aa2 Bump cargo to 1.88; 2024 edition for kcl-lib (#7618)
This is a big one because the edition changes a fair number of things.
2025-06-26 22:02:54 +00:00

21 lines
430 B
Rust

use std::{env, fs};
use kcl_to_core::*;
#[tokio::main]
async fn main() {
let args: Vec<String> = env::args().collect();
if args.len() < 2 {
println!("Usage: kcl-to-core path/to/file.kcl");
return;
}
let file_path = &args[1];
let kcl = fs::read_to_string(file_path).expect("read file");
let result = kcl_to_engine_core(&kcl).await.expect("kcl conversion");
println!("{result}");
}