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:
parent
271bad9b08
commit
921aa50d18
1 changed files with 4 additions and 2 deletions
|
@ -12,15 +12,17 @@ fn main() {
|
||||||
let crate_version = format!("v{}", crate_version!());
|
let crate_version = format!("v{}", crate_version!());
|
||||||
env_logger::Builder::from_env(env_logger::Env::default().default_filter_or("warn")).init();
|
env_logger::Builder::from_env(env_logger::Env::default().default_filter_or("warn")).init();
|
||||||
let d_arg = arg!(-d --"dest-dir" <DEST_DIR>
|
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]
|
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")
|
let matches = Command::new("rustbook")
|
||||||
.about("Build a book with mdBook")
|
.about("Build a book with mdBook")
|
||||||
.author("Steve Klabnik <steve@steveklabnik.com>")
|
.author("Steve Klabnik <steve@steveklabnik.com>")
|
||||||
.version(&*crate_version)
|
.version(&*crate_version)
|
||||||
.subcommand_required(true)
|
.subcommand_required(true)
|
||||||
|
.arg_required_else_help(true)
|
||||||
.subcommand(
|
.subcommand(
|
||||||
Command::new("build")
|
Command::new("build")
|
||||||
.about("Build the book from the markdown files")
|
.about("Build the book from the markdown files")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue