diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2016-04-22 17:10:44 +0200 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2016-06-09 15:41:42 +0200 |
commit | 55c833226cd56008f024fb589c748784e39c6ce2 (patch) | |
tree | 0e006f90ae60a94710c3ce8310b1232bae97a575 /imag-diary | |
parent | c5beb34614a2eeef6718137733bc043106c7bad4 (diff) |
Add user interface definition
Diffstat (limited to 'imag-diary')
-rw-r--r-- | imag-diary/src/ui.rs | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/imag-diary/src/ui.rs b/imag-diary/src/ui.rs new file mode 100644 index 00000000..ac0b70bc --- /dev/null +++ b/imag-diary/src/ui.rs @@ -0,0 +1,45 @@ +use clap::{Arg, App, SubCommand}; + +pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> { + app + .arg(Arg::with_name("diaryname") + .long("diary") + .short("d") + .takes_value(true) + .required(false) + .help("Use other than default diary")) + + .subcommand(SubCommand::with_name("create") + .about("Create a diary entry") + .version("0.1") + .arg(Arg::with_name("no-edit") + .long("no-edit") + .short("e") + .takes_value(false) + .required(false) + .help("Do not edit after creating")) + ) + + .subcommand(SubCommand::with_name("edit") + .about("Edit a diary entry") + .version("0.1") + .arg(Arg::with_name("datetime") + .long("datetime") + .short("d") + .takes_value(true) + .required(false) + .help("Specify the date and time which entry should be edited. If none is + specified, the last entry is edited. If the diary entry does not exist for + this time, this fails. Format: YYYY-MM-DDT[HH[:mm[:ss]]]")) + ) + + .subcommand(SubCommand::with_name("list") + .about("List diary entries") + .version("0.1")) + + // TODO: Support deleting diary entries + // .subcommand(SubCommand::with_name("delete") + // .about("Delete a diary entry") + // .version("0.1") +} + |