diff options
| author | Eric Huss <eric@huss.org> | 2024-10-23 10:52:12 -0700 |
|---|---|---|
| committer | Eric Huss <eric@huss.org> | 2024-10-23 11:44:23 -0700 |
| commit | df8551b60aa2b3442ccda21ac5a8bcabd2a7d67c (patch) | |
| tree | 8d1ff259d9058857d6d10921a8245db56bd744e3 /src/tools | |
| parent | 87fb4eaa9d892d3331c2651736d6d141ea827b90 (diff) | |
| download | rust-df8551b60aa2b3442ccda21ac5a8bcabd2a7d67c.tar.gz rust-df8551b60aa2b3442ccda21ac5a8bcabd2a7d67c.zip | |
Update rustbook to support new test linking in reference
Diffstat (limited to 'src/tools')
| -rw-r--r-- | src/tools/rustbook/src/main.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/tools/rustbook/src/main.rs b/src/tools/rustbook/src/main.rs index 2118af61396..f905b9277ff 100644 --- a/src/tools/rustbook/src/main.rs +++ b/src/tools/rustbook/src/main.rs @@ -22,6 +22,11 @@ fn main() { .required(false) .value_parser(clap::value_parser!(String)); + let root_arg = arg!(--"rust-root" <ROOT_DIR> +"Path to the root of the rust source tree") + .required(false) + .value_parser(clap::value_parser!(PathBuf)); + let dir_arg = arg!([dir] "Root directory for the book\n\ (Defaults to the current directory when omitted)") .value_parser(clap::value_parser!(PathBuf)); @@ -37,6 +42,7 @@ fn main() { .about("Build the book from the markdown files") .arg(d_arg) .arg(l_arg) + .arg(root_arg) .arg(&dir_arg), ) .subcommand( @@ -96,7 +102,8 @@ pub fn build(args: &ArgMatches) -> Result3<()> { } if book.config.get_preprocessor("spec").is_some() { - book.with_preprocessor(Spec::new()); + let rust_root = args.get_one::<PathBuf>("rust-root").cloned(); + book.with_preprocessor(Spec::new(rust_root)?); } book.build()?; |
