diff options
| author | Quey-Liang Kao <s101062801@m101.nthu.edu.tw> | 2017-01-18 21:17:57 +0800 |
|---|---|---|
| committer | Quey-Liang Kao <s101062801@m101.nthu.edu.tw> | 2017-01-18 21:17:57 +0800 |
| commit | 468e1d8d6a4e9c5fe2ce7ace27c003e5b7063f78 (patch) | |
| tree | b59a93ccd4b13c684ce756d945f5ffabd03c1ad2 | |
| parent | 0466449099372abdde5f7a1ab9d5fa1788618a41 (diff) | |
| parent | de346783c83061b2b88e5b158f6a659d569f206e (diff) | |
Merge github.com:gammons/todolist
| -rw-r--r-- | todo.go | 2 | ||||
| -rw-r--r-- | todolist/app.go | 2 | ||||
| -rw-r--r-- | todolist/formatter.go | 2 | ||||
| -rw-r--r-- | todolist/parser.go | 4 |
4 files changed, 5 insertions, 5 deletions
@@ -111,7 +111,7 @@ func routeInput(command string, input string) { app.ListTodos(input) case "a", "add": app.AddTodo(input) - case "d", "del": + case "d", "delete": app.DeleteTodo(input) case "c", "complete": app.CompleteTodo(input) diff --git a/todolist/app.go b/todolist/app.go index 19eed08..e09875f 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 } diff --git a/todolist/formatter.go b/todolist/formatter.go index c884862..b259f6a 100644 --- a/todolist/formatter.go +++ b/todolist/formatter.go @@ -29,7 +29,7 @@ func (f *Formatter) Print() { cyan := color.New(color.FgCyan).SprintFunc() var keys []string - for key, _ := range f.GroupedTodos.Groups { + for key := range f.GroupedTodos.Groups { keys = append(keys, key) } sort.Strings(keys) diff --git a/todolist/parser.go b/todolist/parser.go index 6919bd7..767785b 100644 --- a/todolist/parser.go +++ b/todolist/parser.go @@ -61,7 +61,7 @@ func (p *Parser) Due(input string, day time.Time) string { r, _ := regexp.Compile(`due .*$`) res := r.FindString(input) - res = res[4:len(res)] + res = res[4:] switch res { case "none": return "" @@ -167,7 +167,7 @@ func (p *Parser) matchWords(input string, r *regexp.Regexp) []string { ret := []string{} for _, val := range results { - ret = append(ret, val[1:len(val)]) + ret = append(ret, val[1:]) } return ret } |
