diff options
| author | steveklabnik <steve@steveklabnik.com> | 2018-01-25 12:32:25 -0500 |
|---|---|---|
| committer | steveklabnik <steve@steveklabnik.com> | 2018-02-04 15:47:35 -0500 |
| commit | 5437188e100d704516dd5803378ee5ccd29edfe1 (patch) | |
| tree | 2872d3e4c7ffe76413a68ffe952cee53f38f9c22 /src/tools | |
| parent | b320829da41d6f93e0f2f9f4218502f1073626a4 (diff) | |
| download | rust-5437188e100d704516dd5803378ee5ccd29edfe1.tar.gz rust-5437188e100d704516dd5803378ee5ccd29edfe1.zip | |
update mdbook to 0.1.2
and improve printing of errors
Diffstat (limited to 'src/tools')
| -rw-r--r-- | src/tools/rustbook/Cargo.toml | 2 | ||||
| -rw-r--r-- | src/tools/rustbook/src/main.rs | 10 |
2 files changed, 8 insertions, 4 deletions
diff --git a/src/tools/rustbook/Cargo.toml b/src/tools/rustbook/Cargo.toml index bc35cbe9fbb..539b434e9ec 100644 --- a/src/tools/rustbook/Cargo.toml +++ b/src/tools/rustbook/Cargo.toml @@ -8,5 +8,5 @@ license = "MIT/Apache-2.0" clap = "2.25.0" [dependencies.mdbook] -version = "0.0.28" +version = "0.1.2" default-features = false diff --git a/src/tools/rustbook/src/main.rs b/src/tools/rustbook/src/main.rs index 50f4364e448..87a63a34cb6 100644 --- a/src/tools/rustbook/src/main.rs +++ b/src/tools/rustbook/src/main.rs @@ -13,7 +13,6 @@ extern crate mdbook; extern crate clap; use std::env; -use std::io::{self, Write}; use std::path::{Path, PathBuf}; use clap::{App, ArgMatches, SubCommand, AppSettings}; @@ -45,14 +44,19 @@ fn main() { }; if let Err(e) = res { - writeln!(&mut io::stderr(), "An error occured:\n{}", e).ok(); + eprintln!("Error: {}", e); + + for cause in e.iter().skip(1) { + eprintln!("\tCaused By: {}", cause); + } + ::std::process::exit(101); } } // Build command implementation pub fn build(args: &ArgMatches) -> Result<()> { let book_dir = get_book_dir(args); - let mut book = MDBook::new(&book_dir).read_config()?; + let mut book = MDBook::load(&book_dir)?; // Set this to allow us to catch bugs in advance. book.config.build.create_missing = false; |
