diff options
| author | Quey-Liang Kao <s101062801@m101.nthu.edu.tw> | 2017-08-20 22:45:31 +0800 |
|---|---|---|
| committer | Quey-Liang Kao <s101062801@m101.nthu.edu.tw> | 2017-08-20 22:45:31 +0800 |
| commit | 34639c4285621177efb10b82ddb07cd0017af56a (patch) | |
| tree | 6a3828ef5f1af8a2bcf74a03eabe33f896a3dbf7 /todo.go | |
| parent | ebc7b53438ef6328baf813c7cad19e43839ad0f1 (diff) | |
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.
Diffstat (limited to 'todo.go')
| -rw-r--r-- | todo.go | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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() |
