// Check which subcomamnd the user ran...
let res = match matches.subcommand() {
("build", Some(sub_matches)) => build(sub_matches),
- ("test", Some(sub_matches)) => test(sub_matches),
(_, _) => unreachable!(),
};
Ok(())
}
-fn test(args: &ArgMatches) -> Result<(), Box<Error>> {
- let mut book = build_mdbook_struct(args);
-
- try!(book.test());
-
- Ok(())
-}
-
fn build_mdbook_struct(args: &ArgMatches) -> mdbook::MDBook {
let book_dir = get_book_dir(args);
let mut book = MDBook::new(&book_dir).read_config();