File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 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>>;
77fn main ( ) -> Result < ( ) > {
88 let mut args = std:: env:: args ( ) . skip ( 1 ) ;
99 let cmd = args. next ( ) ;
10+ const OPTIONS : & str = "linkcheck, style-check, test-all" ;
1011 match cmd. as_deref ( ) {
1112 Some ( "test-all" ) => {
1213 mdbook_test ( ) ?;
@@ -18,14 +19,13 @@ fn main() -> Result<()> {
1819 }
1920 Some ( "linkcheck" ) => linkcheck ( args) ?,
2021 Some ( "style-check" ) => style_check ( ) ?,
22+ Some ( "-h" | "--help" ) => eprintln ! ( "valid options: {OPTIONS}" ) ,
2123 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})" ) ;
2525 exit ( 1 ) ;
2626 }
2727 None => {
28- eprintln ! ( "error: specify a command (valid options: linkcheck, style-check, test-all )" ) ;
28+ eprintln ! ( "error: specify a command (valid options: {OPTIONS} )" ) ;
2929 exit ( 1 ) ;
3030 }
3131 }
You can’t perform that action at this time.
0 commit comments