Add value_name() call in ui specification code

This commit is contained in:
Matthias Beyer 2016-06-08 14:11:13 +02:00
parent d0104e7e67
commit 6a8a8150fd

View file

@ -7,26 +7,30 @@ pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> {
.short("i") .short("i")
.takes_value(true) .takes_value(true)
.required(false) .required(false)
.help("Increment a counter")) .help("Increment a counter")
.value_name("COUNTER"))
.arg(Arg::with_name("decrement") .arg(Arg::with_name("decrement")
.long("dec") .long("dec")
.short("d") .short("d")
.takes_value(true) .takes_value(true)
.required(false) .required(false)
.help("Decrement a counter")) .help("Decrement a counter")
.value_name("COUNTER"))
.arg(Arg::with_name("reset") .arg(Arg::with_name("reset")
.long("reset") .long("reset")
.takes_value(true) .takes_value(true)
.required(false) .required(false)
.help("Reset a counter")) .help("Reset a counter")
.value_name("COUNTER"))
.arg(Arg::with_name("set") .arg(Arg::with_name("set")
.long("set") .long("set")
.takes_value(true) .takes_value(true)
.required(false) .required(false)
.help("Set a counter")) .help("Set a counter")
.value_name("COUNTER"))
.subcommand(SubCommand::with_name("create") .subcommand(SubCommand::with_name("create")
.about("Create a counter") .about("Create a counter")
@ -36,13 +40,15 @@ pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> {
.short("n") .short("n")
.takes_value(true) .takes_value(true)
.required(true) .required(true)
.help("Create counter with this name")) .help("Create counter with this name")
.value_name("NAME"))
.arg(Arg::with_name("initval") .arg(Arg::with_name("initval")
.long("init") .long("init")
.short("i") .short("i")
.takes_value(true) .takes_value(true)
.required(false) .required(false)
.help("Initial value"))) .help("Initial value")
.value_name("VALUE")))
.subcommand(SubCommand::with_name("delete") .subcommand(SubCommand::with_name("delete")
.about("Delete a counter") .about("Delete a counter")
@ -52,7 +58,8 @@ pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> {
.short("n") .short("n")
.takes_value(true) .takes_value(true)
.required(true) .required(true)
.help("Create counter with this name"))) .help("Create counter with this name")
.value_name("NAME")))
.subcommand(SubCommand::with_name("list") .subcommand(SubCommand::with_name("list")
.about("List counters") .about("List counters")
@ -62,28 +69,32 @@ pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> {
.short("n") .short("n")
.takes_value(true) .takes_value(true)
.required(false) .required(false)
.help("List counters with this name (foo/bar and baz/bar would match 'bar')")) .help("List counters with this name (foo/bar and baz/bar would match 'bar')")
.value_name("NAME"))
.arg(Arg::with_name("greater-than") .arg(Arg::with_name("greater-than")
.long("greater") .long("greater")
.short("g") .short("g")
.takes_value(true) .takes_value(true)
.required(false) .required(false)
.help("List counters which are greater than VALUE")) .help("List counters which are greater than VALUE")
.value_name("VALUE"))
.arg(Arg::with_name("lower-than") .arg(Arg::with_name("lower-than")
.long("lower") .long("lower")
.short("l") .short("l")
.takes_value(true) .takes_value(true)
.required(false) .required(false)
.help("List counters which are lower than VALUE")) .help("List counters which are lower than VALUE")
.value_name("VALUE"))
.arg(Arg::with_name("equals") .arg(Arg::with_name("equals")
.long("equal") .long("equal")
.short("e") .short("e")
.takes_value(true) .takes_value(true)
.required(false) .required(false)
.help("List counters which equal VALUE")) .help("List counters which equal VALUE")
.value_name("VALUE"))
) )
.subcommand(SubCommand::with_name("interactive") .subcommand(SubCommand::with_name("interactive")
@ -97,6 +108,6 @@ pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> {
.required(true) .required(true)
.help("Specification for key-bindings. Use <KEY>=<VALUE> where KEY is the .help("Specification for key-bindings. Use <KEY>=<VALUE> where KEY is the
key to bind (single character) and VALUE is the path to the counter to bind key to bind (single character) and VALUE is the path to the counter to bind
to."))) to.")
.value_name("KEY=VALUE")))
} }