Skip to content

Commit 4ee87d5

Browse files
committed
Add support for --no-default-features to cargo-semver
1 parent 6ee972f commit 4ee87d5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/bin/cargo_semver.rs

+10
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,10 @@ fn run(config: &cargo::Config, matches: &getopts::Matches, explain: bool) -> Res
153153
child.args(&["--target", &target]);
154154
}
155155

156+
if !matches.opt_present("no-default-features") {
157+
child.args(&["--cfg", "feature=\"default\""]);
158+
}
159+
156160
let child = child
157161
.arg("-")
158162
.stdin(Stdio::piped())
@@ -215,6 +219,11 @@ mod cli {
215219
"api-guidelines",
216220
"report only changes that are breaking according to the API-guidelines",
217221
);
222+
opts.optflag(
223+
"",
224+
"no-default-features",
225+
"Do not activate the `default` feature",
226+
);
218227
opts.optopt(
219228
"s",
220229
"stable-path",
@@ -397,6 +406,7 @@ impl<'a> WorkInfo<'a> {
397406
if let Some(target) = matches.opt_str("target") {
398407
opts.build_config.requested_target = Some(target);
399408
}
409+
opts.no_default_features = matches.opt_present("no-default-features");
400410

401411
// TODO: this is where we could insert feature flag builds (or using the CLI mechanisms)
402412

0 commit comments

Comments
 (0)