Merge pull request #466 from matthiasbeyer/binary-enhance-ui

Binary enhance ui
This commit is contained in:
Matthias Beyer 2016-06-08 16:39:22 +02:00
commit 34d702ea83
7 changed files with 87 additions and 51 deletions

View file

@ -7,26 +7,30 @@ pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> {
.short("i")
.takes_value(true)
.required(false)
.help("Increment a counter"))
.help("Increment a counter")
.value_name("COUNTER"))
.arg(Arg::with_name("decrement")
.long("dec")
.short("d")
.takes_value(true)
.required(false)
.help("Decrement a counter"))
.help("Decrement a counter")
.value_name("COUNTER"))
.arg(Arg::with_name("reset")
.long("reset")
.takes_value(true)
.required(false)
.help("Reset a counter"))
.help("Reset a counter")
.value_name("COUNTER"))
.arg(Arg::with_name("set")
.long("set")
.takes_value(true)
.required(false)
.help("Set a counter"))
.help("Set a counter")
.value_name("COUNTER"))
.subcommand(SubCommand::with_name("create")
.about("Create a counter")
@ -36,13 +40,15 @@ pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> {
.short("n")
.takes_value(true)
.required(true)
.help("Create counter with this name"))
.help("Create counter with this name")
.value_name("NAME"))
.arg(Arg::with_name("initval")
.long("init")
.short("i")
.takes_value(true)
.required(false)
.help("Initial value")))
.help("Initial value")
.value_name("VALUE")))
.subcommand(SubCommand::with_name("delete")
.about("Delete a counter")
@ -52,7 +58,8 @@ pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> {
.short("n")
.takes_value(true)
.required(true)
.help("Create counter with this name")))
.help("Create counter with this name")
.value_name("NAME")))
.subcommand(SubCommand::with_name("list")
.about("List counters")
@ -62,28 +69,32 @@ pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> {
.short("n")
.takes_value(true)
.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")
.long("greater")
.short("g")
.takes_value(true)
.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")
.long("lower")
.short("l")
.takes_value(true)
.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")
.long("equal")
.short("e")
.takes_value(true)
.required(false)
.help("List counters which equal VALUE"))
.help("List counters which equal VALUE")
.value_name("VALUE"))
)
.subcommand(SubCommand::with_name("interactive")
@ -97,6 +108,6 @@ pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> {
.required(true)
.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
to.")))
to.")
.value_name("KEY=VALUE")))
}

View file

@ -13,14 +13,16 @@ pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> {
.short("f")
.takes_value(true)
.required(true)
.help("Link from this entry"))
.help("Link from this entry")
.value_name("ENTRY"))
.arg(Arg::with_name("to")
.long("to")
.short("t")
.takes_value(true)
.required(true)
.multiple(true)
.help("Link to this entries"))
.help("Link to this entries")
.value_name("ENTRIES"))
)
.subcommand(SubCommand::with_name("remove")
@ -31,14 +33,16 @@ pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> {
.short("f")
.takes_value(true)
.required(true)
.help("Remove Link from this entry"))
.help("Remove Link from this entry")
.value_name("ENTRY"))
.arg(Arg::with_name("to")
.long("to")
.short("t")
.takes_value(true)
.required(true)
.multiple(true)
.help("Remove links to these entries"))
.help("Remove links to these entries")
.value_name("ENTRIES"))
)
.arg(Arg::with_name("list")
@ -46,7 +50,8 @@ pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> {
.short("l")
.takes_value(true)
.required(false)
.help("List links to this entry"))
.help("List links to this entry")
.value_name("ENTRY"))
)
.subcommand(SubCommand::with_name("external")
.about("Add and remove external links")
@ -57,14 +62,16 @@ pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> {
.short("i")
.takes_value(true)
.required(true)
.help("Modify external link of this entry"))
.help("Modify external link of this entry")
.value_name("ENTRY"))
.arg(Arg::with_name("add")
.long("add")
.short("a")
.takes_value(true)
.required(false)
.help("Add this URI as external link"))
.help("Add this URI as external link")
.value_name("URI"))
.arg(Arg::with_name("remove")
.long("remove")
@ -78,7 +85,8 @@ pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> {
.short("s")
.takes_value(true)
.required(false)
.help("Set these URIs as external link (seperate by comma)"))
.help("Set these URIs as external link (seperate by comma)")
.value_name("URIs"))
.arg(Arg::with_name("list")
.long("list")
@ -93,4 +101,3 @@ pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> {
)
}

View file

@ -13,7 +13,8 @@ pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> {
.short("n")
.takes_value(true)
.required(true)
.help("Create Note with this name"))
.help("Create Note with this name")
.value_name("NAME"))
.arg(Arg::with_name("edit")
.long("edit")
.short("e")
@ -30,7 +31,8 @@ pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> {
.short("n")
.takes_value(true)
.required(true)
.help("Delete Note with this name")))
.help("Delete Note with this name")
.value_name("NAME")))
.subcommand(SubCommand::with_name("edit")
.about("Edit a Note")
@ -40,7 +42,8 @@ pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> {
.short("n")
.takes_value(true)
.required(true)
.help("Edit Note with this name"))
.help("Edit Note with this name")
.value_name("NAME"))
.arg(tag_argument())
.group(ArgGroup::with_name("editargs")
@ -53,5 +56,3 @@ pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> {
.version("0.1"))
}

View file

@ -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"))
)
}

View file

@ -8,7 +8,8 @@ pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> {
.short("i")
.takes_value(true)
.required(true)
.help("Use this entry"))
.help("Use this entry")
.value_name("ID"))
.arg(tag_add_arg())
.arg(tag_remove_arg())
@ -39,7 +40,8 @@ pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> {
.short("s")
.takes_value(true)
.required(false)
.help("Seperated by string"))
.help("Separated by string")
.value_name("SEP"))
.group(ArgGroup::with_name("list-group")
.args(&[
@ -52,5 +54,3 @@ pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> {
)
}

View file

@ -7,14 +7,16 @@ pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> {
.short("i")
.takes_value(true)
.required(true)
.help("View this entry at this store path"))
.help("View this entry at this store path")
.value_name("ID"))
.arg(Arg::with_name("version")
.long("version")
.short("V")
.takes_value(true)
.required(false)
.help("View this version (youngest if not specified)"))
.help("View this version (youngest if not specified)")
.value_name("VERSION"))
.arg(Arg::with_name("versions")
.long("versions")
@ -71,21 +73,24 @@ pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> {
.short("b")
.takes_value(true) // optional, which browser
.required(false)
.help("View content in $BROWSER (fails if no env variable $BROWSER)"))
.help("View content in $BROWSER (fails if no env variable $BROWSER)")
.value_name("BROWSER"))
.arg(Arg::with_name("view-in-texteditor")
.long("editor")
.short("e")
.takes_value(true) // optional, which editor
.required(false)
.help("View content in $EDITOR"))
.help("View content in $EDITOR")
.value_name("EDITOR"))
.arg(Arg::with_name("view-in-custom")
.long("custom")
.short("c")
.takes_value(true) // non-optional, call-string
.required(false)
.help("View content in custom program, for example 'libreoffice %e', replace '%e' with entry path"))
.help("View content in custom program, for example 'libreoffice %e', replace '%e' with entry path")
.value_name("PROGRAM"))
.group(ArgGroup::with_name("viewer")
.args(&["view-in-stdout",
@ -105,15 +110,15 @@ pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> {
.short("f")
.takes_value(true) // "markdown" or "textile" or "restructuredtex"
.required(true)
.help("Compile from"))
.help("Compile from")
.value_name("FORMAT"))
.arg(Arg::with_name("to")
.long("to")
.short("t")
.takes_value(true) // "html" or "HTML" or ... json maybe?
.required(true)
.help("Compile to"))
.help("Compile to")
.value_name("FORMAT"))
)
}

View file

@ -18,6 +18,7 @@ pub fn tag_add_arg<'a, 'b>() -> Arg<'a, 'b> {
.short("a")
.long("add")
.takes_value(true)
.value_name("tags")
.multiple(true)
.help("Add tags, seperated by comma or by specifying multiple times")
}
@ -27,6 +28,7 @@ pub fn tag_remove_arg<'a, 'b>() -> Arg<'a, 'b> {
.short("r")
.long("remove")
.takes_value(true)
.value_name("tags")
.multiple(true)
.help("Remove tags, seperated by comma or by specifying multiple times")
}