From 05b64e4315ba17960f5bb2119e79eec2476459b2 Mon Sep 17 00:00:00 2001 From: Quey-Liang Kao Date: Mon, 16 Jan 2017 00:46:28 +0800 Subject: Bugfix: "todo a" no longer adds an empty todo --- todolist/app.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'todolist/app.go') diff --git a/todolist/app.go b/todolist/app.go index 44d97f5..7644d46 100644 --- a/todolist/app.go +++ b/todolist/app.go @@ -25,6 +25,10 @@ func (a *App) AddTodo(input string) { a.Load() parser := &Parser{} todo := parser.ParseNewTodo(input) + if todo == nil { + fmt.Println("What to do?") + return + } a.TodoList.Add(todo) a.Save() -- cgit v1.3 From e85b6a5c808ad579e9cc81c57fccccd2498819dc Mon Sep 17 00:00:00 2001 From: Quey-Liang Kao Date: Tue, 17 Jan 2017 03:59:15 +0800 Subject: Provide a more helpful message --- todolist/app.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'todolist/app.go') diff --git a/todolist/app.go b/todolist/app.go index 7644d46..45b9812 100644 --- a/todolist/app.go +++ b/todolist/app.go @@ -26,7 +26,7 @@ func (a *App) AddTodo(input string) { parser := &Parser{} todo := parser.ParseNewTodo(input) if todo == nil { - fmt.Println("What to do?") + fmt.Println("I need more information. Try something like 'todo a chat with @bob due tom'") return } -- cgit v1.3