Collect simple stats about engine usage (#5823)

Signed-off-by: Nick Cameron <nrc@ncameron.org>
This commit is contained in:
Nick Cameron
2025-03-18 16:19:24 +13:00
committed by GitHub
parent 0688ce7fe9
commit 988a068d6d
8 changed files with 67 additions and 7 deletions

View File

@ -11,7 +11,13 @@ use kcl_lib::{ExecState, ExecutorContext, ExecutorSettings, Program};
async fn main() {
let mut args = env::args();
args.next();
let filename = args.next().unwrap_or_else(|| "main.kcl".to_owned());
let mut filename = args.next().unwrap_or_else(|| "main.kcl".to_owned());
if !filename.ends_with(".kcl") {
if !filename.ends_with('/') && !filename.ends_with('\\') {
filename += "/";
}
filename += "main.kcl";
}
let mut f = File::open(&filename).unwrap();
let mut text = String::new();