Skip to content

Commit

Permalink
Auto merge of #5081 - matklad:document-not-all-the-things, r=alexcric…
Browse files Browse the repository at this point in the history
…hton

Support --exclude option for `cargo doc`

I think this should have been implemented when the feature was added for
other commands. Probably just an oversight.

cc #4031

r? @alexcrichton
  • Loading branch information
bors committed Feb 26, 2018
2 parents cd2ae96 + 9816c95 commit 31847ee
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/bin/doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ pub struct Options {
flag_frozen: bool,
flag_locked: bool,
flag_all: bool,
flag_exclude: Vec<String>,
#[serde(rename = "flag_Z")]
flag_z: Vec<String>,
}
Expand All @@ -42,6 +43,7 @@ Options:
--open Opens the docs in a browser after the operation
-p SPEC, --package SPEC ... Package to document
--all Document all packages in the workspace
--exclude SPEC ... Exclude packages from the build
--no-deps Don't build documentation for dependencies
-j N, --jobs N Number of parallel jobs, defaults to # of CPUs
--lib Document only this package's library
Expand Down Expand Up @@ -88,11 +90,9 @@ pub fn execute(options: Options, config: &mut Config) -> CliResult {
let root = find_root_manifest_for_wd(options.flag_manifest_path, config.cwd())?;
let ws = Workspace::new(&root, config)?;

let spec = if options.flag_all || (ws.is_virtual() && options.flag_package.is_empty()) {
Packages::All
} else {
Packages::Packages(&options.flag_package)
};
let spec = Packages::from_flags(options.flag_all,
&options.flag_exclude,
&options.flag_package)?;

let empty = Vec::new();
let doc_opts = ops::DocOptions {
Expand Down

0 comments on commit 31847ee

Please sign in to comment.