Extract args into new helper functions
This commit is contained in:
parent
727bc217aa
commit
f4f807bc13
1 changed files with 18 additions and 12 deletions
|
@ -9,20 +9,26 @@ pub fn tag_subcommand<'a, 'b>() -> App<'a, 'b> {
|
||||||
.author("Matthias Beyer <mail@beyermatthias.de>")
|
.author("Matthias Beyer <mail@beyermatthias.de>")
|
||||||
.version("0.1")
|
.version("0.1")
|
||||||
.about("Add or remove tags")
|
.about("Add or remove tags")
|
||||||
|
.arg(tag_add_arg())
|
||||||
|
.arg(tag_remove_arg())
|
||||||
|
}
|
||||||
|
|
||||||
.arg(Arg::with_name(tag_subcommand_add_arg_name())
|
pub fn tag_add_arg<'a, 'b>() -> Arg<'a, 'b> {
|
||||||
|
Arg::with_name(tag_subcommand_add_arg_name())
|
||||||
.short("a")
|
.short("a")
|
||||||
.long("add")
|
.long("add")
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.multiple(true)
|
.multiple(true)
|
||||||
.help("Add tags, seperated by comma or by specifying multiple times"))
|
.help("Add tags, seperated by comma or by specifying multiple times")
|
||||||
|
}
|
||||||
|
|
||||||
.arg(Arg::with_name(tag_subcommand_remove_arg_name())
|
pub fn tag_remove_arg<'a, 'b>() -> Arg<'a, 'b> {
|
||||||
|
Arg::with_name(tag_subcommand_remove_arg_name())
|
||||||
.short("r")
|
.short("r")
|
||||||
.long("remove")
|
.long("remove")
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.multiple(true)
|
.multiple(true)
|
||||||
.help("Remove tags, seperated by comma or by specifying multiple times"))
|
.help("Remove tags, seperated by comma or by specifying multiple times")
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn tag_subcommand_name() -> &'static str {
|
pub fn tag_subcommand_name() -> &'static str {
|
||||||
|
|
Loading…
Reference in a new issue