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. --- todo.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'todo.go') diff --git a/todo.go b/todo.go index cda6cc3..d2bc7ab 100644 --- a/todo.go +++ b/todo.go @@ -123,9 +123,11 @@ func usage() { fmt.Println("\tDeletes a todo with id 33\n") blueBold.Println("\nManipulating notes") + yellow.Println("\ttodo ln") + fmt.Println("\tlists all todos with their notes") yellow.Println("\ttodo an 12 check http://this.web.site") fmt.Println("\tAdds notes \"check http://this.web.site\" to the todo with id 12\n") - yellow.Println("\ttodo ln 12") + yellow.Println("\ttodo n 12") fmt.Println("\tLists notes of the todo with id 12\n") yellow.Println("\ttodo dn 12 3") fmt.Println("\tDeletes the 3rd note of the todo with id 12\n") @@ -143,7 +145,7 @@ func usage() { func routeInput(command string, input string) { app := todolist.NewApp() switch command { - case "l", "list", "agenda": + case "l", "ln", "list", "agenda": app.ListTodos(input) case "a", "add": app.AddTodo(input) @@ -163,7 +165,7 @@ func routeInput(command string, input string) { app.EditTodo(input) case "ex", "expand": app.ExpandTodo(input) - case "an", "ln", "dn", "en": + case "an", "n", "dn", "en": app.ManipulateNotes(input) case "gc": app.GarbageCollect() -- cgit v1.3