From 849d36ec6cd7eb5dd6da01ac602d8f761b4b83e1 Mon Sep 17 00:00:00 2001 From: Joshua Holmer Date: Fri, 4 Mar 2016 14:20:41 -0500 Subject: [PATCH] Enable `quiet` when `stdout` is selected --- CHANGELOG.md | 1 + src/main.rs | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 029d7c0b..b4039abe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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)) diff --git a/src/main.rs b/src/main.rs index 0044ea24..989473f0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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; }