From 34639c4285621177efb10b82ddb07cd0017af56a Mon Sep 17 00:00:00 2001 From: Quey-Liang Kao Date: Sun, 20 Aug 2017 22:45:31 +0800 Subject: Redefine sub-commands: "ln" and "n" Sub-command "ln" is redefined to the function of listing all todos with their notes; "n" replaces original "ln", listing the notes of a specific todo. --- todolist/parser.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'todolist/parser.go') diff --git a/todolist/parser.go b/todolist/parser.go index 42af133..8f5e180 100644 --- a/todolist/parser.go +++ b/todolist/parser.go @@ -91,11 +91,11 @@ func (p *Parser) ParseNotes(todo *Todo, input string) string { todo.Notes = append(todo.Notes, matches[2]) return "add" - case "ln": + case "n": groups := map[string][]*Todo{} groups[""] = append(groups[""], todo) formatter := NewFormatter(&GroupedTodos{Groups: groups}) - formatter.PrintNotes() + formatter.Print(true) return "list" case "dn": -- cgit v1.3