summaryrefslogtreecommitdiff
path: root/interact.go
diff options
context:
space:
mode:
Diffstat (limited to 'interact.go')
-rw-r--r--interact.go48
1 files changed, 38 insertions, 10 deletions
diff --git a/interact.go b/interact.go
index 0c9f73b..932ce1d 100644
--- a/interact.go
+++ b/interact.go
@@ -128,7 +128,7 @@ func interact() {
c.Println(boldRed(arg,"is not a valid id!"))
}
}else{
- c.Println(boldRed("deletetask <id> - Please enter an id"))
+ c.Println(boldRed("deletebill <id> - Please enter an id"))
showLastBills(0)
}
c.Println(promptcol("______________________"))
@@ -152,8 +152,14 @@ func interact() {
c.Println(boldRed(arg,"is not a valid id!"))
}
}else{
- c.Println(boldRed("deletetask <id> - Please enter an id"))
- allProjects()
+ tids := getTaskIds()
+ selids,lids := getTaskList(tids,false)
+ choice := c.MultiChoice(lids,"Select a Task to Edit")
+ if choice > -1 {
+ deleteTask(selids[choice])
+ }
+ //c.Println(boldRed("deletetask <id> - Please enter an id"))
+ //allProjects()
}
c.Println(promptcol("______________________"))
},
@@ -177,8 +183,15 @@ func interact() {
c.Println(boldRed(arg,"is not a valid id!"))
}
}else{
- c.Println(boldRed("project <id> - Please enter an id"))
- allProjects()
+ pids := getProjectIds()
+ selids,lids := getProjectList(pids)
+ choice := c.MultiChoice(lids,"Select a Project to Edit")
+ if choice > -1 {
+ setProject(selids[choice])
+ }
+ //c.Println(boldRed("editproject <id> - Please enter an id"))
+ //c.Println(boldRed("project <id> - Please enter an id"))
+ //allProjects()
}
c.Println(promptcol("______________________"))
},
@@ -204,8 +217,8 @@ func interact() {
tids := getTaskIds()
selids,lids := getTaskList(tids,false)
choice := c.MultiChoice(lids,"Select a Task to Edit")
- c.Println(tids)
- c.Println(selids)
+ //c.Println(tids)
+ //c.Println(selids)
if choice > -1 {
editTask(selids[choice])
//c.Println(choice,selids[choice])
@@ -229,7 +242,7 @@ func interact() {
argi,err := strconv.Atoi(arg)
if err == nil{
editProject(argi)
- allProjects()
+ //allProjects()
//stdOut()
}else{
c.Println(boldRed(arg,"is not a valid id!"))
@@ -238,8 +251,8 @@ func interact() {
pids := getProjectIds()
selids,lids := getProjectList(pids)
choice := c.MultiChoice(lids,"Select a Project to Edit")
- c.Println(pids)
- c.Println(selids)
+ //c.Println(pids)
+ //c.Println(selids)
if choice > -1 {
editProject(selids[choice])
//c.Println(choice,selids[choice])
@@ -631,6 +644,21 @@ func interact() {
//fmt.Println("Laboravi emeritus...")
}
+
+
+func getInterInput(question string) (out string) {
+ shell := ishell.New()
+ //shell.SetMultiChoicePrompt(" ->"," - ")
+ //shell.SetChecklistOptions("[ ] ","[X] ")
+ shell.ShowPrompt(false)
+ defer shell.ShowPrompt(true)
+
+ shell.Print(question)
+ out = shell.ReadLine()
+
+ return
+}
+
func multichoice(about string) {
shell := ishell.New()