File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ type Result<T> = std::result::Result<T, Box<dyn Error>>;
7
7
fn main ( ) -> Result < ( ) > {
8
8
let mut args = std:: env:: args ( ) . skip ( 1 ) ;
9
9
let cmd = args. next ( ) ;
10
+ const OPTIONS : & ' static str = "linkcheck, style-check, test-all" ;
10
11
match cmd. as_deref ( ) {
11
12
Some ( "test-all" ) => {
12
13
mdbook_test ( ) ?;
@@ -18,14 +19,13 @@ fn main() -> Result<()> {
18
19
}
19
20
Some ( "linkcheck" ) => linkcheck ( args) ?,
20
21
Some ( "style-check" ) => style_check ( ) ?,
22
+ Some ( "-h" | "--help" ) => eprintln ! ( "valid options: {OPTIONS}" ) ,
21
23
Some ( x) => {
22
- eprintln ! (
23
- "error: unknown command `{x}` (valid options: linkcheck, style-check, test-all)"
24
- ) ;
24
+ eprintln ! ( "error: unknown command `{x}` (valid options: {OPTIONS})" ) ;
25
25
exit ( 1 ) ;
26
26
}
27
27
None => {
28
- eprintln ! ( "error: specify a command (valid options: linkcheck, style-check, test-all )" ) ;
28
+ eprintln ! ( "error: specify a command (valid options: {OPTIONS} )" ) ;
29
29
exit ( 1 ) ;
30
30
}
31
31
}
You can’t perform that action at this time.
0 commit comments