Added a new flag (exclude) to not overlead the ignore flag
diff --git a/README.md b/README.md
index 7b5a7f7..4b52509 100644
--- a/README.md
+++ b/README.md
@@ -112,7 +112,8 @@
-h, --help Prints help information
--format FORMAT Output formatting [default: list]
[values: list, json]
- -i, --ignore DEPENDENCIES Space separated list of dependencies to ignore
+ -i, --ignore DEPENDENCIES Comma separated list of dependencies to not print in the output
+ -x, --exclude DEPENDENCIES Comma separated list of dependencies to exclude from building
-q, --quiet Suppresses warnings
-R, --root-deps-only Only check root dependencies (Equivalent to --depth=1)
-V, --version Prints version information
diff --git a/src/cargo_ops/temp_project.rs b/src/cargo_ops/temp_project.rs
index 2ca6259..dfdf76a 100644
--- a/src/cargo_ops/temp_project.rs
+++ b/src/cargo_ops/temp_project.rs
@@ -473,14 +473,15 @@
) -> CargoResult<()> {
let dep_keys: Vec<_> = dependencies.keys().cloned().collect();
for dep_key in dep_keys {
- // this, by brute force, allows a user to ignore a dependency by not writing
+ // this, by brute force, allows a user to exclude a dependency by not writing
// it to the temp project's manifest
// In short this allows cargo to build the package with semver minor compatibilities issues
// https://github.com/rust-lang/cargo/issues/6584
// https://github.com/kbknapp/cargo-outdated/issues/230
- if self.options.flag_ignore.contains(&dep_key) {
+ if self.options.flag_exclude.contains(&dep_key) {
continue;
}
+
let original = dependencies.get(&dep_key).cloned().unwrap();
match original {
diff --git a/src/main.rs b/src/main.rs
index d1b642d..7b903c5 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -23,7 +23,8 @@
-h, --help Prints help information
--format FORMAT Output formatting [default: list]
[values: list, json]
- -i, --ignore DEPENDENCIES Space separated list of dependencies to ignore
+ -i, --ignore DEPENDENCIES Comma separated list of dependencies to not print in the output
+ -x, --exclude DEPENDENCIES Comma separated list of dependencies to exclude from building
-q, --quiet Suppresses warnings
-R, --root-deps-only Only check root dependencies (Equivalent to --depth=1)
-V, --version Prints version information
@@ -49,6 +50,7 @@
flag_color: Option<String>,
flag_features: Vec<String>,
flag_ignore: Vec<String>,
+ flag_exclude: Vec<String>,
flag_manifest_path: Option<String>,
flag_quiet: bool,
flag_verbose: u32,
@@ -100,6 +102,7 @@
}
options.flag_features = flat_split(&options.flag_features);
options.flag_ignore = flat_split(&options.flag_ignore);
+ options.flag_exclude = flat_split(&options.flag_exclude);
options.flag_packages = flat_split(&options.flag_packages);
if options.flag_root_deps_only {
options.flag_depth = Some(1);