This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -9,13 +9,19 @@ mod utils;
99macro_rules! arg_error {
1010 ( $( $err: tt) * ) => { {
1111 eprintln!( $( $err) * ) ;
12+ eprintln!( ) ;
1213 usage( ) ;
1314 std:: process:: exit( 1 ) ;
1415 } } ;
1516}
1617
1718fn usage ( ) {
18- // println!("{}", include_str!("usage.txt"));
19+ println ! ( "\
20+ Available commands for build_system:
21+
22+ prepare : Run prepare command
23+ build : Run build command
24+ --help : Show this message" ) ;
1925}
2026
2127pub enum Command {
@@ -31,6 +37,10 @@ fn main() {
3137 let command = match env:: args ( ) . nth ( 1 ) . as_deref ( ) {
3238 Some ( "prepare" ) => Command :: Prepare ,
3339 Some ( "build" ) => Command :: Build ,
40+ Some ( "--help" ) => {
41+ usage ( ) ;
42+ process:: exit ( 0 ) ;
43+ }
3444 Some ( flag) if flag. starts_with ( '-' ) => arg_error ! ( "Expected command found flag {}" , flag) ,
3545 Some ( command) => arg_error ! ( "Unknown command {}" , command) ,
3646 None => {
Original file line number Diff line number Diff line change 22
33set -e
44echo " [BUILD] build system" 1>&2
5- mkdir -p build_system/target
6- rustc build_system/src/main.rs -o build_system/target/y -Cdebuginfo=1 --edition 2021
7- exec ./build_system/target/y " $@ "
5+ cd build_system
6+ cargo build --release
7+ cd ..
8+ ./build_system/target/release/y $@
You can’t perform that action at this time.
0 commit comments