summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorNikolaus Gotsche <n@softwarefools.com>2018-01-21 16:00:15 +0100
committerNikolaus Gotsche <n@softwarefools.com>2018-01-21 16:00:15 +0100
commit2b1503c57722a417038d3e2dafa7faa23ef59a5b (patch)
treeed0c32345d5f6d454faf6a74c71e9c8ef195458a /main.go
parentad7fca31d412ca605723f777ec56a7e6a45569e7 (diff)
Edit Tasks implemented
Minor changes in the UI
Diffstat (limited to 'main.go')
-rw-r--r--main.go33
1 files changed, 23 insertions, 10 deletions
diff --git a/main.go b/main.go
index c572819..6681bb4 100644
--- a/main.go
+++ b/main.go
@@ -10,9 +10,9 @@ import (
_ "os/exec"
)
-var svar string
+//var svar string
var starttime,stoptime string
-var projectid int
+var projectid, edittaskid, editprojectid int
var newproject, newtask, stoptask, allproj bool
func init() {
@@ -22,30 +22,38 @@ func init() {
false,
"Show all Projects")
flag.BoolVar(&newtask,
- "start",
+ "startnow",
false,
"Start a new Task in current project")
+ flag.IntVar(&edittaskid,
+ "edittask",
+ 0,
+ "Specify which Task to edit")
+ flag.IntVar(&editprojectid,
+ "editproject",
+ 0,
+ "Specify which project to edit")
flag.IntVar(&projectid,
"project",
0,
"Specify which project to track")
flag.BoolVar(&stoptask,
- "stop",
+ "stopnow",
false,
"Stop the currently open task")
flag.StringVar(&starttime,
- "starttime",
+ "start",
"now",
- "")
+ "Start a new Task in current project\nFormat: 'YYYY-MM-DD HH:MM' or 'HH:MM'")
flag.StringVar(&stoptime,
- "stoptime",
+ "stop",
"now",
- "Stop to Track a Project")
+ "Stop to Track the current Task\nFormat: 'YYYY-MM-DD HH:MM' or 'HH:MM'")
flag.BoolVar(&newproject,
"new",
false,
"Create a new project")
- flag.StringVar(&svar, "svar", "bar", "A String Var")
+ //flag.StringVar(&svar, "svar", "bar", "A String Var")
flag.Parse()
@@ -69,9 +77,10 @@ func main() {
newProject()
os.Exit(0)
} else if newtask {
+ newTask(projectid)
showLastProject()
getClosedTasks(0)
- newTask(projectid)
+ showOpenTask()
os.Exit(0)
} else if stoptask {
closeTask()
@@ -86,6 +95,10 @@ func main() {
showLastProject()
getClosedTasks(0)
showOpenTask()
+ } else if (edittaskid>0) {
+ editTask(edittaskid)
+ } else if (editprojectid>0) {
+ editProject(editprojectid)
} else if (projectid>0) {
setProject(projectid)
showLastProject()