File tree 1 file changed +11
-1
lines changed
1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -9,13 +9,19 @@ mod utils;
9
9
macro_rules! arg_error {
10
10
( $( $err: tt) * ) => { {
11
11
eprintln!( $( $err) * ) ;
12
+ eprintln!( ) ;
12
13
usage( ) ;
13
14
std:: process:: exit( 1 ) ;
14
15
} } ;
15
16
}
16
17
17
18
fn 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" ) ;
19
25
}
20
26
21
27
pub enum Command {
@@ -31,6 +37,10 @@ fn main() {
31
37
let command = match env:: args ( ) . nth ( 1 ) . as_deref ( ) {
32
38
Some ( "prepare" ) => Command :: Prepare ,
33
39
Some ( "build" ) => Command :: Build ,
40
+ Some ( "--help" ) => {
41
+ usage ( ) ;
42
+ process:: exit ( 0 ) ;
43
+ }
34
44
Some ( flag) if flag. starts_with ( '-' ) => arg_error ! ( "Expected command found flag {}" , flag) ,
35
45
Some ( command) => arg_error ! ( "Unknown command {}" , command) ,
36
46
None => {
You can’t perform that action at this time.
0 commit comments