54 lines
1.9 KiB
Rust
54 lines
1.9 KiB
Rust
use clap::{Arg, App, SubCommand};
|
|
|
|
use libimagentrytag::ui::tag_argument;
|
|
|
|
pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> {
|
|
app
|
|
.subcommand(SubCommand::with_name("create")
|
|
.about("Create a note")
|
|
.version("0.1")
|
|
.arg(Arg::with_name("name")
|
|
.long("name")
|
|
.short("n")
|
|
.takes_value(true)
|
|
.required(true)
|
|
.help("Create Note with this name")
|
|
.value_name("NAME"))
|
|
.arg(Arg::with_name("edit")
|
|
.long("edit")
|
|
.short("e")
|
|
.takes_value(false)
|
|
.required(false)
|
|
.help("Edit after creating"))
|
|
)
|
|
|
|
.subcommand(SubCommand::with_name("delete")
|
|
.about("Delete a Note")
|
|
.version("0.1")
|
|
.arg(Arg::with_name("name")
|
|
.long("name")
|
|
.short("n")
|
|
.takes_value(true)
|
|
.required(true)
|
|
.help("Delete Note with this name")
|
|
.value_name("NAME")))
|
|
|
|
.subcommand(SubCommand::with_name("edit")
|
|
.about("Edit a Note")
|
|
.version("0.1")
|
|
.arg(Arg::with_name("name")
|
|
.long("name")
|
|
.short("n")
|
|
.takes_value(true)
|
|
.required(true)
|
|
.help("Edit Note with this name")
|
|
.value_name("NAME"))
|
|
|
|
.arg(tag_argument())
|
|
)
|
|
|
|
.subcommand(SubCommand::with_name("list")
|
|
.about("List Notes")
|
|
.version("0.1"))
|
|
|
|
}
|