add mock subcommand resume
This commit is contained in:
parent
3e67ea0a44
commit
0f8ff24d44
23
src/main.rs
23
src/main.rs
|
@ -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")
|
||||
|
|
Loading…
Reference in New Issue