From 3a8537682e613c6c75b42b302fa2b949dd6396e7 Mon Sep 17 00:00:00 2001 From: Klesti Selimaj Date: Thu, 2 Jul 2026 20:57:02 +0200 Subject: [PATCH] Added more cli commands #100 --- src/main.mist | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/src/main.mist b/src/main.mist index 481cd81..d71cb0a 100644 --- a/src/main.mist +++ b/src/main.mist @@ -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");