Skip to content

Commit 921aa50

Browse files
committed
Fix epage's nits
* Use real newlines in command descriptions * Make `--dest-dir` optional * Show help message when no subcommand is supplied
1 parent 271bad9 commit 921aa50

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Diff for: src/tools/rustbook/src/main.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,17 @@ fn main() {
1212
let crate_version = format!("v{}", crate_version!());
1313
env_logger::Builder::from_env(env_logger::Env::default().default_filter_or("warn")).init();
1414
let d_arg = arg!(-d --"dest-dir" <DEST_DIR>
15-
"The output directory for your book{n}(Defaults to ./book when omitted)");
15+
"The output directory for your book\n(Defaults to ./book when omitted)")
16+
.required(false);
1617
let dir_arg = arg!([dir]
17-
"A directory for your book{n}(Defaults to Current Directory when omitted)");
18+
"A directory for your book\n(Defaults to Current Directory when omitted)");
1819

1920
let matches = Command::new("rustbook")
2021
.about("Build a book with mdBook")
2122
.author("Steve Klabnik <[email protected]>")
2223
.version(&*crate_version)
2324
.subcommand_required(true)
25+
.arg_required_else_help(true)
2426
.subcommand(
2527
Command::new("build")
2628
.about("Build the book from the markdown files")

0 commit comments

Comments
 (0)