From 0ca8f6bc0b7284f70062600934c18430ea9be0b6 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Wed, 8 Jun 2016 14:11:13 +0200 Subject: [PATCH] Add value_name() call in ui specification code --- imag-store/src/ui.rs | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/imag-store/src/ui.rs b/imag-store/src/ui.rs index e9ccb7e4..220c8433 100644 --- a/imag-store/src/ui.rs +++ b/imag-store/src/ui.rs @@ -9,17 +9,20 @@ pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> { .short("p") .takes_value(true) .required(false) - .help("Create at this store path")) + .help("Create at this store path") + .value_name("PATH")) .arg(Arg::with_name("id") .long("id") .short("i") .takes_value(true) .required(false) - .help("Same as --path, for consistency")) + .help("Same as --path, for consistency") + .value_name("PATH")) .arg(Arg::with_name("from-raw") .long("from-raw") .takes_value(true) - .help("Create a new entry by reading this file ('-' for stdin)")) + .help("Create a new entry by reading this file ('-' for stdin)") + .value_name("FILE")) .group(ArgGroup::with_name("create-destination-group") .args(&["path", "id"]) @@ -32,12 +35,14 @@ pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> { .long("content") .short("c") .takes_value(true) - .help("Content for the Entry from commandline")) + .help("Content for the Entry from commandline") + .value_name("CONTENT")) .arg(Arg::with_name("content-from") .long("content-from") .short("f") .takes_value(true) - .help("Content for the Entry from this file ('-' for stdin)")) + .help("Content for the Entry from this file ('-' for stdin)") + .value_name("CONTENT")) .group(ArgGroup::with_name("create-content-group") .args(&["content", "content-from"]) @@ -48,7 +53,8 @@ pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> { .short("h") .takes_value(true) .multiple(true) - .help("Set a header field. Specify as 'header.field.value=value', multiple allowed")) + .help("Set a header field. Specify as 'header.field.value=value', multiple allowed") + .value_name("header.field.value=value")) ) ) @@ -103,7 +109,8 @@ pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> { .short("i") .takes_value(true) .required(true) - .help("Retreive by Store Path, where root (/) is the store itself")) + .help("Retrieve by Store Path, where root (/) is the store itself") + .value_name("PATH")) .arg(Arg::with_name("content") .long("content") .short("c") @@ -129,6 +136,7 @@ pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> { .short("w") .takes_value(true) .help("Filter with 'header.field=foo' where the header field 'header.field' equals 'foo'") + .value_name("header.field=foo") ) .arg(Arg::with_name("header-field-grep") .long("grep") @@ -146,12 +154,14 @@ pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> { .short("i") .takes_value(true) .required(true) - .help("Update Store Entry with this path. Root (/) is the store itself")) + .help("Update Store Entry with this path. Root (/) is the store itself") + .value_name("PATH")) .arg(Arg::with_name("content") .long("content") .short("c") .takes_value(true) - .help("Take the content for the new Entry from this file ('-' for stdin)")) + .help("Take the content for the new Entry from this file ('-' for stdin)") + .value_name("CONTENT")) .arg(Arg::with_name("header") .long("header") .short("h") @@ -168,7 +178,7 @@ pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> { .short("i") .takes_value(true) .required(true) - .help("Remove Store Entry with this path. Root (/) is the store itself")) + .help("Remove Store Entry with this path. Root (/) is the store itself") + .value_name("PATH")) ) } -