From 9011ccbd585d06ba9eaea94b8cac8780f749d5d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kornel=20Lesin=CC=81ski?= Date: Mon, 9 Jul 2018 17:26:27 +0100 Subject: [PATCH] CLI args value names --- src/main.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main.rs b/src/main.rs index 6e0334d8..e18c5137 100644 --- a/src/main.rs +++ b/src/main.rs @@ -37,6 +37,7 @@ fn main() { .short("o") .long("opt") .takes_value(true) + .value_name("level") .possible_value("0") .possible_value("1") .possible_value("2") @@ -60,12 +61,14 @@ fn main() { .help("Write output file(s) to ") .long("dir") .takes_value(true) + .value_name("directory") .conflicts_with("output_file") .conflicts_with("stdout")) .arg(Arg::with_name("output_file") .help("Write output file to ") .long("out") .takes_value(true) + .value_name("file") .conflicts_with("output_dir") .conflicts_with("stdout")) .arg(Arg::with_name("stdout") @@ -113,12 +116,14 @@ fn main() { .short("i") .long("interlace") .takes_value(true) + .value_name("0/1") .possible_value("0") .possible_value("1")) .arg(Arg::with_name("compression") .help("zlib compression levels (1-9) - Default: 9") .long("zc") .takes_value(true) + .value_name("levels") .validator(|x| { match parse_numeric_range_opts(&x, 1, 9) { Ok(_) => Ok(()), @@ -139,6 +144,7 @@ fn main() { .help("zlib window size - Default: 32k") .long("zw") .takes_value(true) + .value_name("size") .possible_value("256") .possible_value("512") .possible_value("1k") @@ -170,6 +176,7 @@ fn main() { .help("Strip metadata objects ['safe', 'all', or comma-separated list]") .long("strip") .takes_value(true) + .value_name("mode") .conflicts_with("strip-safe")) .arg(Arg::with_name("strip-safe") .help("Strip safely-removable metadata objects") @@ -184,6 +191,7 @@ fn main() { .long("threads") .short("t") .takes_value(true) + .value_name("num") .validator(|x| { match x.parse::() { Ok(val) => {