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 +
diff --git a/src/main.rs b/src/main.rs
index e874403..a3a0abe 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" | "r" | "b" => {
compiler::build();
+ Command::new("cargo").args(&args[1..]).status().unwrap();
}
+ "transpile" | "t" => compiler::build(),
"version" | "--version" | "-v" => {
println!("mist {}", env!("CARGO_PKG_VERSION"));
}
@@ -34,11 +32,17 @@ fn main() {
}
fn print_usage() {
- println!("mist - the mist compiler");
- println!();
+ 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!(" mist build compile the project in the current directory");
- println!(" mist check