summaryrefslogtreecommitdiff
path: root/interact.go
diff options
context:
space:
mode:
authorNikolaus Gotsche <n@softwarefools.com>2019-04-29 01:51:36 +0200
committerNikolaus Gotsche <n@softwarefools.com>2019-04-29 01:51:36 +0200
commitb5bc66a01b24b5a10c04de584c1681898308124b (patch)
tree5be00d024b9f08ea8f09a7b7983e4533619db686 /interact.go
parent60210ae11b7777b4cd41e25c5e3db39be38e4cb5 (diff)
Uncheck Bills0.4.1
Diffstat (limited to 'interact.go')
-rw-r--r--interact.go41
1 files changed, 38 insertions, 3 deletions
diff --git a/interact.go b/interact.go
index 4aae3ac..e3135d3 100644
--- a/interact.go
+++ b/interact.go
@@ -183,7 +183,7 @@ func interact(fulldb bool) {
})
*/
- // Delete Commands: Bill / Task
+ // Delete Commands: Bill / Task / Payment
{
delcmd := &ishell.Cmd{
Name: "delete",
@@ -214,6 +214,37 @@ func interact(fulldb bool) {
},
})
delcmd.AddCmd(&ishell.Cmd{
+ Name: "payment",
+ Help: "<id> Delete the Payment with the following id",
+ LongHelp: ` Usage: delete payment <id>
+ Delete the payment of the set <id>`,
+ Func: func(c *ishell.Context) {
+ arg := "none"
+ if len(c.Args) > 0 {
+ arg = strings.Join(c.Args, " ")
+ argi, err := strconv.Atoi(arg)
+ if err == nil {
+ DeletePayment(argi)
+ stdOut()
+ } else {
+ c.Println(boldRed(arg, " is not a valid id!"))
+ }
+ } else {
+ /*
+ tids := GetTaskIds()
+ selids, lids := GetPaymentList(tids, false,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("______________________"))
+ },
+ })
+ delcmd.AddCmd(&ishell.Cmd{
Name: "task",
Help: "<id> Delete a Task with the following id",
LongHelp: ` Usage: delete task <id>
@@ -227,12 +258,12 @@ func interact(fulldb bool) {
deleteTask(argi)
stdOut()
} else {
- c.Println(boldRed(arg, "is not a valid id!"))
+ c.Println(boldRed(arg, " is not a valid id!"))
}
} else {
tids := GetTaskIds()
selids, lids := GetTaskList(tids, false,false)
- choice := c.MultiChoice(lids, "Select a Task to Edit")
+ choice := c.MultiChoice(lids, "Select a Task to Delete")
if choice > -1 {
deleteTask(selids[choice])
}
@@ -245,6 +276,8 @@ func interact(fulldb bool) {
shell.AddCmd(delcmd)
}
+ // OPEN PROJECT COMMAND
+
shell.AddCmd(&ishell.Cmd{
Name: "project",
Help: "<id> Open a Project of the following id",
@@ -277,6 +310,8 @@ func interact(fulldb bool) {
},
})
+ // EDIT COMMAND
+
{
editcmd := &ishell.Cmd{
Name: "edit",