add mock subcommand resume

This commit is contained in:
Abraham Toriz 2021-07-10 14:17:59 -05:00
parent 3e67ea0a44
commit 0f8ff24d44
No known key found for this signature in database
GPG Key ID: D5B4A746DB5DD42A
1 changed files with 18 additions and 5 deletions

View File

@ -72,6 +72,16 @@ fn main() {
or 'full' to see hidden entries"
);
let at_arg = Arg::with_name("at")
.long("at")
.takes_value(true).value_name("TIME")
.help("Use this time instead of now");
let id_arg = Arg::with_name("id")
.long("id")
.takes_value(true).value_name("ID")
.help("Use entry with ID instead of the last entry");
// Now declar this app's cli
let matches = App::new("Tiempo")
.name("t")
@ -207,17 +217,20 @@ fn main() {
.subcommand(SubCommand::with_name("in")
.visible_alias("i")
.about("Start an activity in the current timesheet")
.arg(Arg::with_name("at")
.long("at")
.takes_value(true)
.value_name("TIME")
.help("Use this time instead of now"))
.arg(at_arg.clone())
.arg(Arg::with_name("note")
.takes_value(true)
.value_name("NOTE")
.help("Text describing the activity to start"))
)
.subcommand(SubCommand::with_name("resume")
.visible_alias("r")
.about("Restart the timer for an entry. Defaults to the last active entry")
.arg(at_arg.clone())
.arg(id_arg.clone())
)
.subcommand(SubCommand::with_name("out")
.visible_alias("o")
.about("end the active entry in the current timesheet")