From 05a630f943aa92d4a830c2fbbb17517e2990811e Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Fri, 22 Dec 2017 13:35:14 +0100 Subject: [PATCH] Change UI. Positional args are not possible here --- bin/domain/imag-habit/src/ui.rs | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/bin/domain/imag-habit/src/ui.rs b/bin/domain/imag-habit/src/ui.rs index 67b0797b..d5148682 100644 --- a/bin/domain/imag-habit/src/ui.rs +++ b/bin/domain/imag-habit/src/ui.rs @@ -30,28 +30,41 @@ pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> { .about("Create a new Habit") .version("0.1") .arg(Arg::with_name("create-name") - .index(1) + .long("name") + .short("n") .multiple(false) .required(true) .takes_value(true) .value_name("NAME") .help("Name of the new habit")) .arg(Arg::with_name("create-date") - .index(2) + .long("date") + .short("d") .multiple(false) .required(true) .takes_value(true) .value_name("DATE") .help("Date when the first instance should be done")) .arg(Arg::with_name("create-date-recurr-spec") - .index(3) + .long("recurr") + .short("r") .multiple(false) .required(true) .takes_value(true) .value_name("RECURRENCE-SPEC") .help("Spec how the habit should recur (eg: 'weekly', 'monthly', '5days', '12hours')")) + .arg(Arg::with_name("create-until") + .long("until") + .short("u") + .multiple(false) + .required(false) + .takes_value(true) + .value_name("UNTIL") + .help("Until-Date for the habit")) + .arg(Arg::with_name("create-comment") - .index(4) + .long("comment") + .short("c") .multiple(true) .required(true) .takes_value(true)