aboutsummaryrefslogtreecommitdiffstats
path: root/todolist/formatter.go
diff options
context:
space:
mode:
authorQuey-Liang Kao <s101062801@m101.nthu.edu.tw>2017-08-14 15:45:22 +0800
committerQuey-Liang Kao <s101062801@m101.nthu.edu.tw>2017-08-14 15:50:13 +0800
commit26ec23620d50be79ea664a9095b3653be79e3874 (patch)
treec7cd8f60f6c5f89850bae7db8622646ab47b86ff /todolist/formatter.go
parent5d28dac9b2e1d153f33551b968ab4c92cfce23ce (diff)
Implement the "ln" feature: Listing notes of a todo
Diffstat (limited to 'todolist/formatter.go')
-rw-r--r--todolist/formatter.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/todolist/formatter.go b/todolist/formatter.go
index c0f3313..847be04 100644
--- a/todolist/formatter.go
+++ b/todolist/formatter.go
@@ -43,6 +43,17 @@ func (f *Formatter) Print() {
f.Writer.Flush()
}
+func (f *Formatter) PrintNotes() {
+ cyan := color.New(color.FgCyan).SprintFunc()
+ todo := f.GroupedTodos.Groups[""][0]
+ f.printTodo(todo)
+ for nid, note := range todo.Notes {
+ fmt.Fprintf(f.Writer, " %s\t%s\t\n",
+ cyan(strconv.Itoa(nid)), note)
+ }
+ f.Writer.Flush()
+}
+
func (f *Formatter) printTodo(todo *Todo) {
yellow := color.New(color.FgYellow)
if todo.IsPriority {