Added more cli commands #100

This commit is contained in:
2026-07-02 20:57:02 +02:00
parent eb23ff1e5a
commit 3a8537682e
+16 -5
View File
@@ -16,7 +16,7 @@ void main()
process::exit(1);
}
match args[1].as_str() {
"run" | "build" | "check" | "r" | "b" | "c" => {
"run" | "build" | "check" | "test" | "publish" | "bench" | "doc" | "fix" | "clippy" | "r" | "b" | "c" => {
let mut root = env::current_dir().expect("Unable to find project root");
modify_args(&mut args, &mut root);
transpiler::transpile(&root);
@@ -32,6 +32,10 @@ void main()
modify_args(&mut args, &mut root);
transpiler::transpile(&root);
}
"clean" => {
args.remove(0);
process::Command::new("cargo").args(args).stdout(process::Stdio::inherit()).stderr(process::Stdio::inherit()).stdin(process::Stdio::inherit()).spawn().expect("Failed to run cargo").wait().expect("Unable to wait");
}
"init" => {
init_project(args);
}
@@ -73,10 +77,17 @@ void print_usage()
println!("󰖟 View our documentation! \x1b[35mhttps://mist.selimaj.dev\x1b[0m");
println!(" Follow us on github! \x1b[35mhttps://github.com/mist-go\x1b[0m\n");
println!("usage:");
println!(" \x1b[36m mist run\x1b[0m,\x1b[36m r\x1b[0m run the project in the current directory\n");
println!(" \x1b[36m mist build\x1b[0m,\x1b[36m b\x1b[0m build the project in the current directory\n");
println!(" \x1b[36m mist transpile\x1b[0m,\x1b[36m t\x1b[0m transpile the project in the current directory\n");
println!(" \x1b[36m mist check\x1b[0m,\x1b[36m c\x1b[0m check the project in the current directory\n");
println!(" \x1b[36m mist run\x1b[0m,\x1b[36m r\x1b[0m run the project\n");
println!(" \x1b[36m mist build\x1b[0m,\x1b[36m b\x1b[0m build the project\n");
println!(" \x1b[36m mist test\x1b[0m test the project\n");
println!(" \x1b[36m mist publish\x1b[0m publish the project\n");
println!(" \x1b[36m mist bench\x1b[0m benchmark the project\n");
println!(" \x1b[36m mist doc\x1b[0m build documentation\n");
println!(" \x1b[36m mist fix\x1b[0m automatically fix warnings\n");
println!(" \x1b[36m mist clippy\x1b[0m lint the project\n");
println!(" \x1b[36m mist check\x1b[0m,\x1b[36m c\x1b[0m check the project\n");
println!(" \x1b[36m mist clean\x1b[0m clean build artifacts\n");
println!(" \x1b[36m mist transpile\x1b[0m,\x1b[36m t\x1b[0m transpile the project\n");
println!(" \x1b[36m mist init\x1b[0m initialize a project in the current folder\n");
println!(" \x1b[36m mist new\x1b[0m create a new project\n");
println!(" \x1b[36m mist version \x1b[0m print the compiler version\n");