Merge pull request #2805 from ehuss/remove-test-dest-dir
Remove `test --dest-dir`
This commit is contained in:
commit
dbb51d32db
2 changed files with 0 additions and 13 deletions
|
|
@ -54,13 +54,6 @@ mdbook test my-book -L target/debug/deps/
|
||||||
See the `rustdoc` command-line [documentation](https://doc.rust-lang.org/rustdoc/command-line-arguments.html#-l--library-path-where-to-look-for-dependencies)
|
See the `rustdoc` command-line [documentation](https://doc.rust-lang.org/rustdoc/command-line-arguments.html#-l--library-path-where-to-look-for-dependencies)
|
||||||
for more information.
|
for more information.
|
||||||
|
|
||||||
#### `--dest-dir`
|
|
||||||
|
|
||||||
The `--dest-dir` (`-d`) option allows you to change the output directory for the
|
|
||||||
book. Relative paths are interpreted relative to the book's root directory. If
|
|
||||||
not specified it will default to the value of the `build.build-dir` key in
|
|
||||||
`book.toml`, or to `./book`.
|
|
||||||
|
|
||||||
#### `--chapter`
|
#### `--chapter`
|
||||||
|
|
||||||
The `--chapter` (`-c`) option allows you to test a specific chapter of the
|
The `--chapter` (`-c`) option allows you to test a specific chapter of the
|
||||||
|
|
|
||||||
|
|
@ -4,14 +4,11 @@ use anyhow::Result;
|
||||||
use clap::ArgAction;
|
use clap::ArgAction;
|
||||||
use clap::builder::NonEmptyStringValueParser;
|
use clap::builder::NonEmptyStringValueParser;
|
||||||
use mdbook_driver::MDBook;
|
use mdbook_driver::MDBook;
|
||||||
use std::path::PathBuf;
|
|
||||||
|
|
||||||
// Create clap subcommand arguments
|
// Create clap subcommand arguments
|
||||||
pub fn make_subcommand() -> Command {
|
pub fn make_subcommand() -> Command {
|
||||||
Command::new("test")
|
Command::new("test")
|
||||||
.about("Tests that a book's Rust code samples compile")
|
.about("Tests that a book's Rust code samples compile")
|
||||||
// FIXME: --dest-dir is unused by the test command, it should be removed
|
|
||||||
.arg_dest_dir()
|
|
||||||
.arg_root_dir()
|
.arg_root_dir()
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new("chapter")
|
Arg::new("chapter")
|
||||||
|
|
@ -46,9 +43,6 @@ pub fn execute(args: &ArgMatches) -> Result<()> {
|
||||||
let book_dir = get_book_dir(args);
|
let book_dir = get_book_dir(args);
|
||||||
let mut book = MDBook::load(book_dir)?;
|
let mut book = MDBook::load(book_dir)?;
|
||||||
|
|
||||||
if let Some(dest_dir) = args.get_one::<PathBuf>("dest-dir") {
|
|
||||||
book.config.build.build_dir = dest_dir.to_path_buf();
|
|
||||||
}
|
|
||||||
match chapter {
|
match chapter {
|
||||||
Some(_) => book.test_chapter(library_paths, chapter),
|
Some(_) => book.test_chapter(library_paths, chapter),
|
||||||
None => book.test(library_paths),
|
None => book.test(library_paths),
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue