From ae396b0399a9ee4ec8aee4879f0eb36bc7aeb7e8 Mon Sep 17 00:00:00 2001 From: Nikolaus Gotsche Date: Sun, 14 Oct 2018 23:40:18 +0200 Subject: Pause Resume and more bugfixing --- interact.go | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) (limited to 'interact.go') diff --git a/interact.go b/interact.go index 3c458e4..136e1d2 100644 --- a/interact.go +++ b/interact.go @@ -64,6 +64,36 @@ func interact() { }, }) + shell.AddCmd(&ishell.Cmd{ + Name: "resume", + Help: "Resume the Paused Task", + LongHelp: ` Usage: resume + Resume the Task that was paused 'now'.`, + Func: func(c *ishell.Context) { + newTask(true) + stdOut() + setPauseTask(0) + c.Println(promptcol("______________________")) + }, + }) + + shell.AddCmd(&ishell.Cmd{ + Name: "pause", + Help: "Close the Current Task and remember it", + LongHelp: ` Usage: pause + Closes the current task 'now' and remember it to continue later. + The User is not asked to enter a comment.`, + Func: func(c *ishell.Context) { + if opentask.id>0 { + setPauseTask(opentask.id) + c.Println("Pausing Task",pausetask) + } + closeTask(false) + stdOut() + c.Println(promptcol("______________________")) + }, + }) + shell.AddCmd(&ishell.Cmd{ Name: "status", Help: "Show Current Project and Tasks", @@ -92,7 +122,7 @@ func interact() { LongHelp: ` Usage: startnow Start a new Task in the currently open Project with current local time`, Func: func(c *ishell.Context) { - newTask(currproject.id) + newTask(false) stdOut() c.Println(promptcol("______________________")) }, @@ -105,7 +135,7 @@ func interact() { Stop the open Task at the current local time. If no task is open the user will be notified.`, Func: func(c *ishell.Context) { - closeTask() + closeTask(true) stdOut() c.Println(promptcol("______________________")) }, -- cgit v1.2.3