From 004a75cafde2b8749cbd692b7a061f2fb5c8a7da Mon Sep 17 00:00:00 2001 From: Michael Zimmermann Date: Mon, 24 Feb 2020 08:05:50 +0100 Subject: [PATCH] Add an option to ignore build dependencies this fixes #51 --- src/args.rs | 3 +++ src/graph.rs | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/args.rs b/src/args.rs index 3d27140..c0be0a1 100644 --- a/src/args.rs +++ b/src/args.rs @@ -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, diff --git a/src/graph.rs b/src/graph.rs index 5776773..9bbed1a 100644 --- a/src/graph.rs +++ b/src/graph.rs @@ -51,6 +51,9 @@ pub fn build(args: &Args, metadata: Metadata) -> Result { 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); }