diff --git a/build_system/src/main.rs b/build_system/src/main.rs index c76418da579..16c4c3a9c62 100644 --- a/build_system/src/main.rs +++ b/build_system/src/main.rs @@ -9,13 +9,19 @@ mod utils; macro_rules! arg_error { ($($err:tt)*) => {{ eprintln!($($err)*); + eprintln!(); usage(); std::process::exit(1); }}; } fn usage() { - // println!("{}", include_str!("usage.txt")); + println!("\ +Available commands for build_system: + + prepare : Run prepare command + build : Run build command + --help : Show this message"); } pub enum Command { @@ -31,6 +37,10 @@ fn main() { let command = match env::args().nth(1).as_deref() { Some("prepare") => Command::Prepare, Some("build") => Command::Build, + Some("--help") => { + usage(); + process::exit(0); + } Some(flag) if flag.starts_with('-') => arg_error!("Expected command found flag {}", flag), Some(command) => arg_error!("Unknown command {}", command), None => { diff --git a/y.sh b/y.sh index 481b909c92a..188109743e3 100755 --- a/y.sh +++ b/y.sh @@ -2,6 +2,7 @@ set -e echo "[BUILD] build system" 1>&2 -mkdir -p build_system/target -rustc build_system/src/main.rs -o build_system/target/y -Cdebuginfo=1 --edition 2021 -exec ./build_system/target/y "$@" +cd build_system +cargo build --release +cd .. +./build_system/target/release/y $@