File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
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 => {
You can’t perform that action at this time.
0 commit comments