From 64adf4a5fbead1ea7b719ad78688e6551524c81b Mon Sep 17 00:00:00 2001 From: mario Date: Mon, 30 May 2016 15:02:30 +0200 Subject: [PATCH 1/2] added exec/add with description,priority,project,due and frequency --- imag-todo/src/ui.rs | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/imag-todo/src/ui.rs b/imag-todo/src/ui.rs index d1707298..3f4f6ab5 100644 --- a/imag-todo/src/ui.rs +++ b/imag-todo/src/ui.rs @@ -41,4 +41,46 @@ pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> { ) -} + .subcommand(SubCommand::with_name("add") + .about("create a task") + .version("0.1") + + .arg(Arg::with_name("description") + .long("description") + .short("d") + .takes_value(true) + .required(true) + .help("Name/Description of the new task") + ) + + .arg(Arg::with_name("priority") + .long("priority") + .short("p") + .takes_value(true) + .required(false) + .help("One of l, m, h for low, medium and high priority") + ) + + .arg(Arg::with_name("project") + .long("project") + .takes_value(true) + .required(false) + .help("Name of the project the task is related to") + ) + + .arg(Arg::with_name("due") + .long("due") + .takes_value(true) + .required(false) + .help("Due date of the new task") + ) + + .arg(Arg::with_name("frequency") + .long("frequency") + .short("f") + .takes_value(true) + .required(false) + .help("Frequency of the recurrence of a task") + ) + +} From f00af56fd67a15fd08392ac3baabc379744c8555 Mon Sep 17 00:00:00 2001 From: mario Date: Wed, 15 Jun 2016 12:55:05 +0200 Subject: [PATCH 2/2] fix syntax error --- imag-todo/src/ui.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imag-todo/src/ui.rs b/imag-todo/src/ui.rs index 3f4f6ab5..a9ec0048 100644 --- a/imag-todo/src/ui.rs +++ b/imag-todo/src/ui.rs @@ -82,5 +82,5 @@ pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> { .required(false) .help("Frequency of the recurrence of a task") ) - + ) }