Enable quiet when stdout is selected

This commit is contained in:
Joshua Holmer 2016-03-04 14:20:41 -05:00
parent c893e32405
commit 849d36ec6c
2 changed files with 7 additions and 5 deletions

View file

@ -1,6 +1,7 @@
**Version 0.1.2** (unreleased)
- Fix program version that is displayed when running `oxipng -V`
- Ensure `--quiet` mode is actually quiet (@SethDusek [#20](https://github.com/shssoichiro/oxipng/pull/20))
- Imply `--quiet` when `--stdout` is enabled
**Version 0.1.1**
- Fix `oxipng *` writing all input files to one output file ([#15](https://github.com/shssoichiro/oxipng/issues/15))

View file

@ -94,7 +94,7 @@ fn main() {
.conflicts_with("output_dir")
.conflicts_with("stdout"))
.arg(Arg::with_name("stdout")
.help("Write output to stdout")
.help("Write output to stdout (implies 'quiet')")
.long("stdout")
.conflicts_with("output_dir")
.conflicts_with("output_file"))
@ -409,10 +409,6 @@ fn parse_opts_into_struct(matches: &ArgMatches, opts: &mut oxipng::Options) -> R
opts.out_file = PathBuf::from(x);
}
if matches.is_present("stdout") {
opts.stdout = true;
}
if matches.is_present("backup") {
opts.backup = true;
}
@ -449,6 +445,11 @@ fn parse_opts_into_struct(matches: &ArgMatches, opts: &mut oxipng::Options) -> R
opts.verbosity = Some(1);
}
if matches.is_present("stdout") {
opts.stdout = true;
opts.verbosity = None;
}
if matches.is_present("no-bit-reduction") {
opts.bit_depth_reduction = false;
}