Skip to content

Commit

Permalink
Add an option to ignore build dependencies
Browse files Browse the repository at this point in the history
this fixes sfackler#51
  • Loading branch information
M1cha committed Feb 24, 2020
1 parent 9b6cad2 commit 004a75c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ pub struct Args {
#[structopt(long = "no-dev-dependencies")]
/// Skip dev dependencies.
pub no_dev_dependencies: bool,
#[structopt(long = "no-build-dependencies")]
/// Skip build dependencies.
pub no_build_dependencies: bool,
#[structopt(long = "manifest-path", value_name = "PATH", parse(from_os_str))]
/// Path to Cargo.toml
pub manifest_path: Option<PathBuf>,
Expand Down
3 changes: 3 additions & 0 deletions src/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ pub fn build(args: &Args, metadata: Metadata) -> Result<Graph, Error> {
if args.no_dev_dependencies && kind == DependencyKind::Development {
continue;
}
if args.no_build_dependencies && kind == DependencyKind::Build {
continue;
}

graph.graph.add_edge(from, to, kind);
}
Expand Down

0 comments on commit 004a75c

Please sign in to comment.