From ed6ab22cbdbc475adf539637e45a67811ec0c15a Mon Sep 17 00:00:00 2001 From: Michael Strùˆder Date: Sat, 29 Apr 2017 16:31:31 +0200 Subject: display an error on malformed input --- todolist/app.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'todolist/app.go') diff --git a/todolist/app.go b/todolist/app.go index 24ebe4d..6d771ef 100644 --- a/todolist/app.go +++ b/todolist/app.go @@ -91,6 +91,18 @@ func (a *App) UnarchiveTodo(input string) { fmt.Println("Todo unarchived.") } +func (a *App) EditTodoSubject(input string) { + a.Load() + _, id, subject := Parser{input}.Parse() + id, todo := a.getId(input) + if id == -1 { + return + } + todo.Subject = subject + a.Save() + fmt.Println("Todo subject updated.") +} + func (a *App) EditTodoDue(input string) { a.Load() id, todo := a.getId(input) -- cgit v1.3