Bump all dependencies

This commit is contained in:
Josh Holmer 2022-01-12 02:47:59 -05:00
parent 7f6fe08b06
commit ece9787822
4 changed files with 114 additions and 134 deletions

View file

@ -1,3 +1,8 @@
### Next
- [Misc] Bump `clap` to 3.0.0
- [Misc] Bump `zopfli` to 0.5.0
### Version 5.0.1 ### Version 5.0.1
- [Bugfix] Fix an issue where -o5 and -o6 were not testing all options - [Bugfix] Fix an issue where -o5 and -o6 were not testing all options

138
Cargo.lock generated
View file

@ -14,15 +14,6 @@ version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234" checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234"
[[package]]
name = "ansi_term"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b"
dependencies = [
"winapi",
]
[[package]] [[package]]
name = "atty" name = "atty"
version = "0.2.14" version = "0.2.14"
@ -52,17 +43,11 @@ version = "1.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
[[package]]
name = "build_const"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b4ae4235e6dac0694637c763029ecea1a2ec9e4e06ec2729bd21ba4d9c863eb7"
[[package]] [[package]]
name = "bytemuck" name = "bytemuck"
version = "1.7.2" version = "1.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72957246c41db82b8ef88a5486143830adeb8227ef9837740bdec67724cf2c5b" checksum = "439989e6b8c38d1b6570a384ef1e49c8848128f5a97f3914baef02920842712f"
[[package]] [[package]]
name = "byteorder" name = "byteorder"
@ -97,17 +82,17 @@ dependencies = [
[[package]] [[package]]
name = "clap" name = "clap"
version = "2.33.3" version = "3.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "37e58ac78573c40708d45522f0d80fa2f01cc4f9b4e2bf749807255454312002" checksum = "1957aa4a5fb388f0a0a73ce7556c5b42025b874e5cdc2c670775e346e97adec0"
dependencies = [ dependencies = [
"ansi_term",
"atty", "atty",
"bitflags", "bitflags",
"indexmap",
"os_str_bytes",
"strsim", "strsim",
"termcolor",
"textwrap", "textwrap",
"unicode-width",
"vec_map",
] ]
[[package]] [[package]]
@ -134,15 +119,6 @@ version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b"
[[package]]
name = "crc"
version = "1.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d663548de7f5cca343f1e0a48d14dcfb0e9eb4e079ec58883b7251539fa10aeb"
dependencies = [
"build_const",
]
[[package]] [[package]]
name = "crc" name = "crc"
version = "2.1.0" version = "2.1.0"
@ -160,18 +136,18 @@ checksum = "ccaeedb56da03b09f598226e25e80088cb4cd25f316e6e4df7d695f0feeb1403"
[[package]] [[package]]
name = "crc32fast" name = "crc32fast"
version = "1.2.1" version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a" checksum = "738c290dfaea84fc1ca15ad9c168d083b05a714e1efddd8edaab678dc28d2836"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
] ]
[[package]] [[package]]
name = "crossbeam-channel" name = "crossbeam-channel"
version = "0.5.1" version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "06ed27e177f16d65f0f0c22a213e17c696ace5dd64b14258b52f9417ccb52db4" checksum = "e54ea8bc3fb1ee042f5aace6e3c6e025d3874866da222930f70ce62aceba0bfa"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"crossbeam-utils", "crossbeam-utils",
@ -190,9 +166,9 @@ dependencies = [
[[package]] [[package]]
name = "crossbeam-epoch" name = "crossbeam-epoch"
version = "0.9.5" version = "0.9.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4ec02e091aa634e2c3ada4a392989e7c3116673ef0ac5b72232439094d73b7fd" checksum = "97242a70df9b89a65d0b6df3c4bf5b9ce03c5b7309019777fbde37e7537f8762"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"crossbeam-utils", "crossbeam-utils",
@ -203,9 +179,9 @@ dependencies = [
[[package]] [[package]]
name = "crossbeam-utils" name = "crossbeam-utils"
version = "0.8.5" version = "0.8.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d82cfc11ce7f2c3faef78d8a684447b40d503d9681acebed6cb728d45940c4db" checksum = "cfcae03edb34f947e64acdb1c33ec169824e20657e9ecb61cef6c8c74dcb8120"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"lazy_static", "lazy_static",
@ -277,9 +253,9 @@ dependencies = [
[[package]] [[package]]
name = "indexmap" name = "indexmap"
version = "1.7.0" version = "1.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5" checksum = "282a6247722caba404c065016bbfa522806e51714c34f5dfc3e4a3a46fcb4223"
dependencies = [ dependencies = [
"autocfg", "autocfg",
"hashbrown", "hashbrown",
@ -288,9 +264,9 @@ dependencies = [
[[package]] [[package]]
name = "itertools" name = "itertools"
version = "0.10.1" version = "0.10.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "69ddb889f9d0d08a67338271fa9b62996bc788c7796a5c18cf057420aaed5eaf" checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3"
dependencies = [ dependencies = [
"either", "either",
] ]
@ -303,24 +279,24 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
[[package]] [[package]]
name = "libc" name = "libc"
version = "0.2.107" version = "0.2.112"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fbe5e23404da5b4f555ef85ebed98fb4083e55a00c317800bc2a50ede9f3d219" checksum = "1b03d17f364a3a042d5e5d46b053bbbf82c92c9430c592dd4c064dc6ee997125"
[[package]] [[package]]
name = "libdeflate-sys" name = "libdeflate-sys"
version = "0.7.3" version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09c81cf7b5510a30d8a1149dcca5fe85715475a05092c786e660edc72dbf24e4" checksum = "7ce0b849741cecad96125e51124570c46741f50db12007224295b63e221f0034"
dependencies = [ dependencies = [
"cc", "cc",
] ]
[[package]] [[package]]
name = "libdeflater" name = "libdeflater"
version = "0.7.3" version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c11c0c8321257b64709e8ee6811d0b4a2ce030806e7ce1f36094bfa2c1de1540" checksum = "b32b70f071880dd130e410be35f8017892837913374a311e277219d3ead3ab18"
dependencies = [ dependencies = [
"libdeflate-sys", "libdeflate-sys",
] ]
@ -335,10 +311,16 @@ dependencies = [
] ]
[[package]] [[package]]
name = "memoffset" name = "memchr"
version = "0.6.4" version = "2.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "59accc507f1338036a0477ef61afdae33cde60840f4dfe481319ce3ad116ddf9" checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a"
[[package]]
name = "memoffset"
version = "0.6.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce"
dependencies = [ dependencies = [
"autocfg", "autocfg",
] ]
@ -404,14 +386,23 @@ dependencies = [
[[package]] [[package]]
name = "num_cpus" name = "num_cpus"
version = "1.13.0" version = "1.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1"
dependencies = [ dependencies = [
"hermit-abi", "hermit-abi",
"libc", "libc",
] ]
[[package]]
name = "os_str_bytes"
version = "6.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e22443d1643a904602595ba1cd8f7d896afe56d26712531c5ff73a15b2fbf64"
dependencies = [
"memchr",
]
[[package]] [[package]]
name = "oxipng" name = "oxipng"
version = "5.0.1" version = "5.0.1"
@ -420,7 +411,7 @@ dependencies = [
"byteorder", "byteorder",
"clap", "clap",
"cloudflare-zlib", "cloudflare-zlib",
"crc 2.1.0", "crc",
"crossbeam-channel", "crossbeam-channel",
"filetime", "filetime",
"image", "image",
@ -485,9 +476,9 @@ dependencies = [
[[package]] [[package]]
name = "rgb" name = "rgb"
version = "0.8.29" version = "0.8.31"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a27fa03bb1e3e2941f52d4a555a395a72bf79b0a85fbbaab79447050c97d978c" checksum = "9a374af9a0e5fdcdd98c1c7b64f05004f9ea2555b6c75f211daa81268a3c50f1"
dependencies = [ dependencies = [
"bytemuck", "bytemuck",
] ]
@ -528,9 +519,9 @@ dependencies = [
[[package]] [[package]]
name = "strsim" name = "strsim"
version = "0.8.0" version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623"
[[package]] [[package]]
name = "termcolor" name = "termcolor"
@ -543,12 +534,9 @@ dependencies = [
[[package]] [[package]]
name = "textwrap" name = "textwrap"
version = "0.11.0" version = "0.14.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" checksum = "0066c8d12af8b5acd21e00547c3797fde4e8677254a7ee429176ccebbe93dd80"
dependencies = [
"unicode-width",
]
[[package]] [[package]]
name = "thread_local" name = "thread_local"
@ -572,21 +560,9 @@ dependencies = [
[[package]] [[package]]
name = "typed-arena" name = "typed-arena"
version = "1.7.0" version = "2.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a9b2228007eba4120145f785df0f6c92ea538f5a3635a612ecf4e334c8c1446d" checksum = "0685c84d5d54d1c26f7d3eb96cd41550adb97baed141a761cf335d3d33bcd0ae"
[[package]]
name = "unicode-width"
version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973"
[[package]]
name = "vec_map"
version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191"
[[package]] [[package]]
name = "wasi" name = "wasi"
@ -636,12 +612,12 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
[[package]] [[package]]
name = "zopfli" name = "zopfli"
version = "0.4.0" version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4079b79464426ade2a1b0177fb0ce8396ba6b4084267407e333573c666073964" checksum = "1e14f4de12c657ae470b6b9b8e1c265f44605d10e652098d4c5be72a28cd4beb"
dependencies = [ dependencies = [
"adler32", "adler32",
"byteorder", "byteorder",
"crc 1.8.1", "crc",
"typed-arena", "typed-arena",
] ]

View file

@ -28,7 +28,7 @@ bit-vec = "^0.6.3"
byteorder = "^1.4.2" byteorder = "^1.4.2"
crc = "^2.0.0" crc = "^2.0.0"
itertools = "^0.10.0" itertools = "^0.10.0"
zopfli = { version = "^0.4.0", optional = true } zopfli = { version = "0.5.0", optional = true }
miniz_oxide = "0.5" miniz_oxide = "0.5"
rgb = "0.8.25" rgb = "0.8.25"
indexmap = "1.6.1" indexmap = "1.6.1"
@ -47,7 +47,7 @@ version = "^1.5.0"
[dependencies.clap] [dependencies.clap]
optional = true optional = true
version = "^2.33.3" version = "3.0.0"
[dependencies.wild] [dependencies.wild]
optional = true optional = true

View file

@ -32,16 +32,15 @@ fn main() {
.author("Joshua Holmer <jholmer.in@gmail.com>") .author("Joshua Holmer <jholmer.in@gmail.com>")
.about("Losslessly improves compression of PNG files") .about("Losslessly improves compression of PNG files")
.setting(AppSettings::DeriveDisplayOrder) .setting(AppSettings::DeriveDisplayOrder)
.setting(AppSettings::UnifiedHelpMessage) .arg(Arg::new("files")
.arg(Arg::with_name("files")
.help("File(s) to compress (use \"-\" for stdin)") .help("File(s) to compress (use \"-\" for stdin)")
.index(1) .index(1)
.multiple(true) .multiple_values(true)
.use_delimiter(false) .use_delimiter(false)
.required(true)) .required(true))
.arg(Arg::with_name("optimization") .arg(Arg::new("optimization")
.help("Optimization level - Default: 2") .help("Optimization level - Default: 2")
.short("o") .short('o')
.long("opt") .long("opt")
.takes_value(true) .takes_value(true)
.value_name("level") .value_name("level")
@ -53,115 +52,115 @@ fn main() {
.possible_value("5") .possible_value("5")
.possible_value("6") .possible_value("6")
.possible_value("max")) .possible_value("max"))
.arg(Arg::with_name("backup") .arg(Arg::new("backup")
.help("Back up modified files") .help("Back up modified files")
.short("b") .short('b')
.long("backup")) .long("backup"))
.arg(Arg::with_name("recursive") .arg(Arg::new("recursive")
.help("Recurse into subdirectories") .help("Recurse into subdirectories")
.short("r") .short('r')
.long("recursive")) .long("recursive"))
.arg(Arg::with_name("output_dir") .arg(Arg::new("output_dir")
.help("Write output file(s) to <directory>") .help("Write output file(s) to <directory>")
.long("dir") .long("dir")
.takes_value(true) .takes_value(true)
.value_name("directory") .value_name("directory")
.conflicts_with("output_file") .conflicts_with("output_file")
.conflicts_with("stdout")) .conflicts_with("stdout"))
.arg(Arg::with_name("output_file") .arg(Arg::new("output_file")
.help("Write output file to <file>") .help("Write output file to <file>")
.long("out") .long("out")
.takes_value(true) .takes_value(true)
.value_name("file") .value_name("file")
.conflicts_with("output_dir") .conflicts_with("output_dir")
.conflicts_with("stdout")) .conflicts_with("stdout"))
.arg(Arg::with_name("stdout") .arg(Arg::new("stdout")
.help("Write output to stdout") .help("Write output to stdout")
.long("stdout") .long("stdout")
.conflicts_with("output_dir") .conflicts_with("output_dir")
.conflicts_with("output_file")) .conflicts_with("output_file"))
.arg(Arg::with_name("preserve") .arg(Arg::new("preserve")
.help("Preserve file attributes if possible") .help("Preserve file attributes if possible")
.short("p") .short('p')
.long("preserve")) .long("preserve"))
.arg(Arg::with_name("pretend") .arg(Arg::new("pretend")
.help("Do not write any files, only calculate compression gains") .help("Do not write any files, only calculate compression gains")
.short("P") .short('P')
.long("pretend")) .long("pretend"))
.arg(Arg::with_name("strip-safe") .arg(Arg::new("strip-safe")
.help("Strip safely-removable metadata objects") .help("Strip safely-removable metadata objects")
.short("s") .short('s')
.conflicts_with("strip")) .conflicts_with("strip"))
.arg(Arg::with_name("strip") .arg(Arg::new("strip")
.help("Strip metadata objects ['safe', 'all', or comma-separated list]") .help("Strip metadata objects ['safe', 'all', or comma-separated list]")
.long("strip") .long("strip")
.takes_value(true) .takes_value(true)
.value_name("mode") .value_name("mode")
.conflicts_with("strip-safe")) .conflicts_with("strip-safe"))
.arg(Arg::with_name("keep") .arg(Arg::new("keep")
.help("Strip all optional metadata except objects in the comma-separated list") .help("Strip all optional metadata except objects in the comma-separated list")
.long("keep") .long("keep")
.takes_value(true) .takes_value(true)
.value_name("list") .value_name("list")
.conflicts_with("strip") .conflicts_with("strip")
.conflicts_with("strip-safe")) .conflicts_with("strip-safe"))
.arg(Arg::with_name("alpha") .arg(Arg::new("alpha")
.help("Perform additional alpha optimizations") .help("Perform additional alpha optimizations")
.short("a") .short('a')
.long("alpha")) .long("alpha"))
.arg(Arg::with_name("interlace") .arg(Arg::new("interlace")
.help("PNG interlace type") .help("PNG interlace type")
.short("i") .short('i')
.long("interlace") .long("interlace")
.takes_value(true) .takes_value(true)
.value_name("0/1") .value_name("0/1")
.possible_value("0") .possible_value("0")
.possible_value("1")) .possible_value("1"))
.arg(Arg::with_name("verbose") .arg(Arg::new("verbose")
.help("Run in verbose mode") .help("Run in verbose mode")
.short("v") .short('v')
.long("verbose") .long("verbose")
.conflicts_with("quiet")) .conflicts_with("quiet"))
.arg(Arg::with_name("quiet") .arg(Arg::new("quiet")
.help("Run in quiet mode") .help("Run in quiet mode")
.short("q") .short('q')
.long("quiet") .long("quiet")
.conflicts_with("verbose")) .conflicts_with("verbose"))
.arg(Arg::with_name("filters") .arg(Arg::new("filters")
.help("PNG delta filters (0-5) - Default: 0,5") .help("PNG delta filters (0-5) - Default: 0,5")
.short("f") .short('f')
.long("filters") .long("filters")
.takes_value(true) .takes_value(true)
.validator(|x| { .validator(|x| {
match parse_numeric_range_opts(&x, 0, 5) { match parse_numeric_range_opts(x, 0, 5) {
Ok(_) => Ok(()), Ok(_) => Ok(()),
Err(_) => Err("Invalid option for filters".to_owned()), Err(_) => Err("Invalid option for filters".to_owned()),
} }
})) }))
.arg(Arg::with_name("compression") .arg(Arg::new("compression")
.help("zlib compression levels (1-9) - Default: 9") .help("zlib compression levels (1-9) - Default: 9")
.long("zc") .long("zc")
.takes_value(true) .takes_value(true)
.value_name("levels") .value_name("levels")
.validator(|x| { .validator(|x| {
match parse_numeric_range_opts(&x, 1, 9) { match parse_numeric_range_opts(x, 1, 9) {
Ok(_) => Ok(()), Ok(_) => Ok(()),
Err(_) => Err("Invalid option for compression".to_owned()), Err(_) => Err("Invalid option for compression".to_owned()),
} }
}) })
.conflicts_with_all(&["zopfli", "libdeflater"])) .conflicts_with_all(&["zopfli", "libdeflater"]))
.arg(Arg::with_name("strategies") .arg(Arg::new("strategies")
.help("zlib compression strategies (0-3) - Default: 0-3") .help("zlib compression strategies (0-3) - Default: 0-3")
.long("zs") .long("zs")
.takes_value(true) .takes_value(true)
.validator(|x| { .validator(|x| {
match parse_numeric_range_opts(&x, 0, 3) { match parse_numeric_range_opts(x, 0, 3) {
Ok(_) => Ok(()), Ok(_) => Ok(()),
Err(_) => Err("Invalid option for strategies".to_owned()), Err(_) => Err("Invalid option for strategies".to_owned()),
} }
}) })
.conflicts_with_all(&["zopfli", "libdeflater"])) .conflicts_with_all(&["zopfli", "libdeflater"]))
.arg(Arg::with_name("window") .arg(Arg::new("window")
.help("zlib window size - Default: 32k") .help("zlib window size - Default: 32k")
.long("zw") .long("zw")
.takes_value(true) .takes_value(true)
@ -175,49 +174,49 @@ fn main() {
.possible_value("16k") .possible_value("16k")
.possible_value("32k") .possible_value("32k")
.conflicts_with_all(&["zopfli", "libdeflater"])) .conflicts_with_all(&["zopfli", "libdeflater"]))
.arg(Arg::with_name("no-bit-reduction") .arg(Arg::new("no-bit-reduction")
.help("No bit depth reduction") .help("No bit depth reduction")
.long("nb")) .long("nb"))
.arg(Arg::with_name("no-color-reduction") .arg(Arg::new("no-color-reduction")
.help("No color type reduction") .help("No color type reduction")
.long("nc")) .long("nc"))
.arg(Arg::with_name("no-palette-reduction") .arg(Arg::new("no-palette-reduction")
.help("No palette reduction") .help("No palette reduction")
.long("np")) .long("np"))
.arg(Arg::with_name("no-grayscale-reduction") .arg(Arg::new("no-grayscale-reduction")
.help("No grayscale reduction") .help("No grayscale reduction")
.long("ng")) .long("ng"))
.arg(Arg::with_name("no-reductions") .arg(Arg::new("no-reductions")
.help("No reductions") .help("No reductions")
.long("nx")) .long("nx"))
.arg(Arg::with_name("no-recoding") .arg(Arg::new("no-recoding")
.help("No IDAT recoding unless necessary") .help("No IDAT recoding unless necessary")
.long("nz")) .long("nz"))
.arg(Arg::with_name("fix") .arg(Arg::new("fix")
.help("Enable error recovery") .help("Enable error recovery")
.long("fix")) .long("fix"))
.arg(Arg::with_name("force") .arg(Arg::new("force")
.help("Write the output even if it is larger than the input") .help("Write the output even if it is larger than the input")
.long("force")) .long("force"))
.arg(Arg::with_name("zopfli") .arg(Arg::new("zopfli")
.help("Use the slower but better compressing Zopfli algorithm, overrides zlib-specific options") .help("Use the slower but better compressing Zopfli algorithm, overrides zlib-specific options")
.short("Z") .short('Z')
.long("zopfli") .long("zopfli")
.conflicts_with("libdeflater")) .conflicts_with("libdeflater"))
.arg(Arg::with_name("libdeflater") .arg(Arg::new("libdeflater")
.help("Use an alternative Libdeflater algorithm, overrides zlib-specific options") .help("Use an alternative Libdeflater algorithm, overrides zlib-specific options")
.short("D") .short('D')
.long("libdeflater") .long("libdeflater")
.conflicts_with("zopfli")) .conflicts_with("zopfli"))
.arg(Arg::with_name("timeout") .arg(Arg::new("timeout")
.help("Maximum amount of time, in seconds, to spend on optimizations") .help("Maximum amount of time, in seconds, to spend on optimizations")
.takes_value(true) .takes_value(true)
.value_name("secs") .value_name("secs")
.long("timeout")) .long("timeout"))
.arg(Arg::with_name("threads") .arg(Arg::new("threads")
.help("Set number of threads to use - default 1.5x CPU cores") .help("Set number of threads to use - default 1.5x CPU cores")
.long("threads") .long("threads")
.short("t") .short('t')
.takes_value(true) .takes_value(true)
.value_name("num") .value_name("num")
.validator(|x| { .validator(|x| {