aboutsummaryrefslogtreecommitdiffstats
path: root/todolist/app.go
diff options
context:
space:
mode:
authorQuey-Liang Kao <s101062801@m101.nthu.edu.tw>2017-08-14 14:41:40 +0800
committerQuey-Liang Kao <s101062801@m101.nthu.edu.tw>2017-08-14 14:58:32 +0800
commit5d28dac9b2e1d153f33551b968ab4c92cfce23ce (patch)
treeb323964d5a61014105b0884e81c9d88be1a74118 /todolist/app.go
parent49ab75141a7799aa746765547bd74cb07b45bfee (diff)
Implement the "an" feature: Adding notes to todos
This patch introduce a new attribute of a todo item, which is "Notes", of type []string. The following enhancing patches will contain the listing, removing and editing features.
Diffstat (limited to 'todolist/app.go')
-rw-r--r--todolist/app.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/todolist/app.go b/todolist/app.go
index 42b1361..c2bd66a 100644
--- a/todolist/app.go
+++ b/todolist/app.go
@@ -132,6 +132,21 @@ func (a *App) ExpandTodo(input string) {
fmt.Println("Todo expanded.")
}
+func (a *App) ManipulateNotes(input string) {
+ a.Load()
+ id, todo := a.getId(input)
+ parser := &Parser{}
+ if id == -1 {
+ return
+ }
+
+ retStr := parser.ParseNotes(todo, input)
+ if retStr != "" {
+ a.Save()
+ fmt.Println("Notes " + retStr + "ed.")
+ }
+}
+
func (a *App) ArchiveCompleted() {
a.Load()
for _, todo := range a.TodoList.Todos() {