From 90de040ae8091e8b2af644b6b49ca87c5fb53f28 Mon Sep 17 00:00:00 2001 From: Klesti Selimaj Date: Sat, 16 May 2026 10:51:08 +0200 Subject: [PATCH 1/5] Cargo commands --- src/main.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main.rs b/src/main.rs index e874403..be0304b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,4 @@ -use std::process; +use std::process::{self, Command}; pub mod codegen; pub mod compiler; @@ -12,13 +12,11 @@ fn main() { } match args[1].as_str() { - "build" => { - if args.len() < 2 { - eprintln!("error: expected a file path\n usage: mist build"); - process::exit(1); - } + "run" | "build" => { compiler::build(); + Command::new("cargo").args(&args[1..]).status().unwrap(); } + "transpile" => compiler::build(), "version" | "--version" | "-v" => { println!("mist {}", env!("CARGO_PKG_VERSION")); } @@ -37,7 +35,9 @@ fn print_usage() { println!("mist - the mist compiler"); println!(); println!("usage:"); - println!(" mist build compile the project in the current directory"); + println!(" mist run run the project in the current directory"); + println!(" mist build build the project in the current directory"); + println!(" mist transpile transpile the project in the current directory"); println!(" mist check parse and validate without compiling"); println!(" mist version print the compiler version"); println!(" mist help print this message"); From 6917d36ac4c2df7a9b03c21cc1c707c86bf27ec6 Mon Sep 17 00:00:00 2001 From: Klesti Selimaj Date: Sat, 16 May 2026 10:52:41 +0200 Subject: [PATCH 2/5] short commands --- src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index be0304b..744132e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -12,11 +12,11 @@ fn main() { } match args[1].as_str() { - "run" | "build" => { + "run" | "build" | "r" | "b" => { compiler::build(); Command::new("cargo").args(&args[1..]).status().unwrap(); } - "transpile" => compiler::build(), + "transpile" | "t" => compiler::build(), "version" | "--version" | "-v" => { println!("mist {}", env!("CARGO_PKG_VERSION")); } From e3d885e22d7866e84f28645c97b9fc78294e0f7f Mon Sep 17 00:00:00 2001 From: Klesti Selimaj Date: Sat, 16 May 2026 10:59:50 +0200 Subject: [PATCH 3/5] improved usage style --- src/main.rs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/main.rs b/src/main.rs index 744132e..6265de8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -32,13 +32,11 @@ fn main() { } fn print_usage() { - println!("mist - the mist compiler"); - println!(); + println!("mist - the mist compiler\n"); println!("usage:"); - println!(" mist run run the project in the current directory"); - println!(" mist build build the project in the current directory"); - println!(" mist transpile transpile the project in the current directory"); - println!(" mist check parse and validate without compiling"); - println!(" mist version print the compiler version"); - println!(" mist help print this message"); + println!(" \x1b[36m mist run\x1b[0m run the project in the current directory\n"); + println!(" \x1b[36m mist build\x1b[0m build the project in the current directory\n"); + println!(" \x1b[36m mist transpile\x1b[0m transpile the project in the current directory\n"); + println!(" \x1b[36m mist version \x1b[0m print the compiler version\n"); + println!(" \x1b[36m mist help\x1b[0m print this message\n"); } From bdca96212c6ea8db19a824d8056c8d87980c119f Mon Sep 17 00:00:00 2001 From: Klesti Selimaj Date: Sat, 16 May 2026 11:10:01 +0200 Subject: [PATCH 4/5] improved usage style --- src/main.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index 6265de8..a3a0abe 100644 --- a/src/main.rs +++ b/src/main.rs @@ -32,11 +32,17 @@ fn main() { } fn print_usage() { - println!("mist - the mist compiler\n"); + println!("Mist - the mist compiler\n"); + 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 run the project in the current directory\n"); - println!(" \x1b[36m mist build\x1b[0m build the project in the current directory\n"); - println!(" \x1b[36m mist transpile\x1b[0m transpile the project in the current directory\n"); + println!( + " \x1b[36m mist build\x1b[0m build the project in the current directory\n" + ); + println!( + " \x1b[36m mist transpile\x1b[0m transpile the project in the current directory\n" + ); println!(" \x1b[36m mist version \x1b[0m print the compiler version\n"); println!(" \x1b[36m mist help\x1b[0m print this message\n"); } From 490509cb1492ab7c321d9f6374309f311fb832a8 Mon Sep 17 00:00:00 2001 From: Klesti Selimaj Date: Sat, 16 May 2026 11:11:41 +0200 Subject: [PATCH 5/5] Documentation website link --- README.md | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index dde8d5c..ca420e1 100644 --- a/README.md +++ b/README.md @@ -4,13 +4,9 @@ Originally this readme was part of the Carbon Language project, licensed with Apache-2.0 --> - +

+ Documentation +