Skip to content

Commit

Permalink
Remove --no-normal-deps
Browse files Browse the repository at this point in the history
It doesn't actually work as-is
  • Loading branch information
jplatte committed Jul 11, 2020
1 parent 28d384e commit 1157148
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
8 changes: 0 additions & 8 deletions src/cli.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use clap::{App, AppSettings, Arg, SubCommand};

pub struct Config {
pub normal_deps: bool,
pub build_deps: bool,
pub dev_deps: bool,
pub target_deps: bool,
Expand Down Expand Up @@ -44,11 +43,6 @@ pub fn parse_options() -> Config {
.long("target-deps")
.help("Include cfg() dependencies in the graph"),
)
.arg(
Arg::with_name("no_normal_deps")
.long("no-normal-deps")
.help("Don't include normal dependencies in the graph"),
)
.arg(Arg::with_name("dedup_transitive_deps").long("dedup-transitive-deps").help(
"Remove direct dependency edges where there's at \
least one transitive dependency of the same kind.",
Expand Down Expand Up @@ -118,7 +112,6 @@ pub fn parse_options() -> Config {
let matches = matches.subcommand_matches("depgraph").unwrap();

let all_deps = matches.is_present("all_deps");
let normal_deps = !matches.is_present("no_normal_deps");
let build_deps = all_deps || matches.is_present("build_deps");
let dev_deps = all_deps || matches.is_present("dev_deps");
let target_deps = all_deps || matches.is_present("target_deps");
Expand All @@ -142,7 +135,6 @@ pub fn parse_options() -> Config {
let unstable_flags = matches.values_of("unstable_flags").map_or_else(Vec::new, collect_owned);

Config {
normal_deps,
build_deps,
dev_deps,
target_deps,
Expand Down
3 changes: 1 addition & 2 deletions src/graph/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,7 @@ fn is_proc_macro(pkg: &MetaPackage) -> bool {
}

pub fn skip_dep(config: &Config, info: &cargo_metadata::DepKindInfo) -> bool {
(!config.normal_deps && info.kind == MetaDepKind::Normal)
|| (!config.build_deps && info.kind == MetaDepKind::Build)
(!config.build_deps && info.kind == MetaDepKind::Build)
|| (!config.dev_deps && info.kind == MetaDepKind::Development)
|| (!config.target_deps && info.target.is_some())
}

0 comments on commit 1157148

Please sign in to comment.