aboutsummaryrefslogtreecommitdiffstats
path: root/todolist/app.go
diff options
context:
space:
mode:
authorGrant Ammons <gammons@gmail.com>2016-05-02 07:25:51 -0400
committerGrant Ammons <gammons@gmail.com>2016-05-02 07:25:51 -0400
commit34c89ec2ca4b458adb94534c4fae44c921181f59 (patch)
treeed3b9e7ab295543938ac4ee2fcadbe915749dd98 /todolist/app.go
parent54e9313ad14269f57a13b32aac59aea17f86d151 (diff)
Uncomplete todo
Diffstat (limited to 'todolist/app.go')
-rw-r--r--todolist/app.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/todolist/app.go b/todolist/app.go
index fec64d2..37961e0 100644
--- a/todolist/app.go
+++ b/todolist/app.go
@@ -47,6 +47,17 @@ func (a *App) CompleteTodo(input string) {
}
}
+func (a *App) UncompleteTodo(input string) {
+ id := a.getId(input)
+ if id != -1 {
+ a.TodoStore.Uncomplete(id)
+ a.TodoStore.Save()
+ fmt.Println("Todo uncompleted.")
+ } else {
+ fmt.Println("Could not find id.")
+ }
+}
+
func (a *App) ListTodos(input string) {
//filtered := NewFilter(a.TodoStore.Todos()).filter()
grouped := a.getGroups(input)