summaryrefslogtreecommitdiff
path: root/interact.go
diff options
context:
space:
mode:
Diffstat (limited to 'interact.go')
-rw-r--r--interact.go61
1 files changed, 58 insertions, 3 deletions
diff --git a/interact.go b/interact.go
index f4a8b4b..0c9f73b 100644
--- a/interact.go
+++ b/interact.go
@@ -201,7 +201,16 @@ func interact() {
c.Println(boldRed(arg,"is not a valid id!"))
}
}else{
- c.Println(boldRed("edittask <id> - Please enter an id"))
+ tids := getTaskIds()
+ selids,lids := getTaskList(tids,false)
+ choice := c.MultiChoice(lids,"Select a Task to Edit")
+ c.Println(tids)
+ c.Println(selids)
+ if choice > -1 {
+ editTask(selids[choice])
+ //c.Println(choice,selids[choice])
+ }
+ //c.Println(boldRed("edittask <id> - Please enter an id"))
}
c.Println(promptcol("______________________"))
},
@@ -226,8 +235,17 @@ func interact() {
c.Println(boldRed(arg,"is not a valid id!"))
}
}else{
- c.Println(boldRed("editproject <id> - Please enter an id"))
- allProjects()
+ pids := getProjectIds()
+ selids,lids := getProjectList(pids)
+ choice := c.MultiChoice(lids,"Select a Project to Edit")
+ c.Println(pids)
+ c.Println(selids)
+ if choice > -1 {
+ editProject(selids[choice])
+ //c.Println(choice,selids[choice])
+ }
+ //c.Println(boldRed("editproject <id> - Please enter an id"))
+ //allProjects()
}
c.Println(promptcol("______________________"))
},
@@ -385,6 +403,17 @@ func interact() {
},
})
*/
+ //Test stuff in shell
+ shell.AddCmd(&ishell.Cmd{
+ Name: "test",
+ Help: "Test some functions in interactive mode",
+ LongHelp: ` Usage: test
+ Test functions in interactive mode`,
+ Func: func(c *ishell.Context) {
+ multichoice("Geh scheissn")
+
+ },
+ })
// Prompt Color
shell.AddCmd(&ishell.Cmd{
@@ -602,4 +631,30 @@ func interact() {
//fmt.Println("Laboravi emeritus...")
}
+func multichoice(about string) {
+ shell := ishell.New()
+ shell.SetMultiChoicePrompt(" ->"," - ")
+ shell.SetChecklistOptions("[ ] ","[X] ")
+
+ shell.AddCmd(&ishell.Cmd{
+ Name: "choice",
+ Help: "multiple choice prompt",
+ Func: func(c *ishell.Context) {
+ choice := c.MultiChoice([]string{
+ "Golangers",
+ "Go programmers",
+ "Gophers",
+ "Goers",
+ }, "What are Go programmers called ?")
+ if choice == 2 {
+ c.Println("You got it!")
+ } else {
+ c.Println("Sorry, you're wrong.")
+ }
+ },
+ })
+ str := "choice"
+ shell.Process(str)
+ shell.Println(about)
+}