Skip to content

Commit e568434

Browse files
committed
Add -q flag to cargo-semver that limits output to important messsages
1 parent 97534c5 commit e568434

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Diff for: src/bin/cargo_semver.rs

+6
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ fn main() {
6262
return;
6363
}
6464

65+
if matches.opt_present("q") {
66+
config.shell().set_verbosity(cargo::core::shell::Verbosity::Quiet);
67+
}
68+
6569
if let Err(e) = cli::validate_args(&matches) {
6670
cli::exit_with_error(&config, e);
6771
}
@@ -214,6 +218,7 @@ mod cli {
214218
opts.optflag("h", "help", "print this message and exit");
215219
opts.optflag("V", "version", "print version information and exit");
216220
opts.optflag("e", "explain", "print detailed error explanations");
221+
opts.optflag("q", "quiet", "surpress regular cargo output, print only important messages");
217222
opts.optflag("d", "debug", "print command to debug and exit");
218223
opts.optflag(
219224
"a",
@@ -293,6 +298,7 @@ mod cli {
293298

294299
/// Exit with error `e`.
295300
pub fn exit_with_error(config: &cargo::Config, e: failure::Error) -> ! {
301+
config.shell().set_verbosity(cargo::core::shell::Verbosity::Normal);
296302
cargo::exit_with_error(CliError::new(e, 1), &mut config.shell());
297303
}
298304
}

0 commit comments

Comments
 (0)