From 921aa50d184e6ccd4a9dd7fc8bf4f6393f30b3f7 Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Mon, 20 Jun 2022 11:04:34 -0700 Subject: [PATCH] Fix epage's nits * Use real newlines in command descriptions * Make `--dest-dir` optional * Show help message when no subcommand is supplied --- src/tools/rustbook/src/main.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/tools/rustbook/src/main.rs b/src/tools/rustbook/src/main.rs index fe7d8d9afe3..3c7dc0183d7 100644 --- a/src/tools/rustbook/src/main.rs +++ b/src/tools/rustbook/src/main.rs @@ -12,15 +12,17 @@ fn main() { let crate_version = format!("v{}", crate_version!()); env_logger::Builder::from_env(env_logger::Env::default().default_filter_or("warn")).init(); let d_arg = arg!(-d --"dest-dir" -"The output directory for your book{n}(Defaults to ./book when omitted)"); +"The output directory for your book\n(Defaults to ./book when omitted)") + .required(false); let dir_arg = arg!([dir] -"A directory for your book{n}(Defaults to Current Directory when omitted)"); +"A directory for your book\n(Defaults to Current Directory when omitted)"); let matches = Command::new("rustbook") .about("Build a book with mdBook") .author("Steve Klabnik ") .version(&*crate_version) .subcommand_required(true) + .arg_required_else_help(true) .subcommand( Command::new("build") .about("Build the book from the markdown files")