Fix epage's nits

* Use real newlines in command descriptions
* Make `--dest-dir` optional
* Show help message when no subcommand is supplied
This commit is contained in:
Michael Howell 2022-06-20 11:04:34 -07:00
parent 271bad9b08
commit 921aa50d18

View File

@ -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" <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 <steve@steveklabnik.com>")
.version(&*crate_version)
.subcommand_required(true)
.arg_required_else_help(true)
.subcommand(
Command::new("build")
.about("Build the book from the markdown files")