diff options
| author | Steve Klabnik <steve@steveklabnik.com> | 2017-02-09 14:44:39 -0500 |
|---|---|---|
| committer | Steve Klabnik <steve@steveklabnik.com> | 2017-02-13 13:41:20 -0500 |
| commit | 775726092eaa4d0e0e397e9032467c2d1d06ed37 (patch) | |
| tree | 0c8aa6f12a7300a9669a261bf2f0cbae1e55a1ce /src/tools/rustbook | |
| parent | 626cf3a263dcac94c88910a6a67018e82b564c75 (diff) | |
| download | rust-775726092eaa4d0e0e397e9032467c2d1d06ed37.tar.gz rust-775726092eaa4d0e0e397e9032467c2d1d06ed37.zip | |
Add exceptions to tidy
We've decided that these deps are okay.
Diffstat (limited to 'src/tools/rustbook')
| -rw-r--r-- | src/tools/rustbook/src/main.rs | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/src/tools/rustbook/src/main.rs b/src/tools/rustbook/src/main.rs index 837c934934a..b77baed5326 100644 --- a/src/tools/rustbook/src/main.rs +++ b/src/tools/rustbook/src/main.rs @@ -1,3 +1,13 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. +// extern crate mdbook; #[macro_use] extern crate clap; @@ -11,19 +21,21 @@ use clap::{App, ArgMatches, SubCommand, AppSettings}; use mdbook::MDBook; -const NAME: &'static str = "rustbook"; - fn main() { - // Create a list of valid arguments and sub-commands - let matches = App::new(NAME) + let d_message = "-d, --dest-dir=[dest-dir] +'The output directory for your book{n}(Defaults to ./book when omitted)'"; + let dir_message = "[dir] +'A directory for your book{n}(Defaults to Current Directory when omitted)'"; + + let matches = App::new("rustbook") .about("Build a book with mdBook") .author("Steve Klabnik <steve@steveklabnik.com>") .version(&*format!("v{}", crate_version!())) .setting(AppSettings::SubcommandRequired) .subcommand(SubCommand::with_name("build") .about("Build the book from the markdown files") - .arg_from_usage("-d, --dest-dir=[dest-dir] 'The output directory for your book{n}(Defaults to ./book when omitted)'") - .arg_from_usage("[dir] 'A directory for your book{n}(Defaults to Current Directory when omitted)'")) + .arg_from_usage(d_message) + .arg_from_usage(dir_message)) .get_matches(); // Check which subcomamnd the user ran... @@ -76,4 +88,3 @@ fn get_book_dir(args: &ArgMatches) -> PathBuf { env::current_dir().unwrap() } } - |
