aboutsummaryrefslogtreecommitdiffstats
path: root/todolist/formatter.go
diff options
context:
space:
mode:
authorQuey-Liang Kao <s101062801@m101.nthu.edu.tw>2017-08-14 16:37:40 +0800
committerQuey-Liang Kao <s101062801@m101.nthu.edu.tw>2017-08-14 16:37:40 +0800
commite1ed1a2357bbf5083e96c883071339235ac0f02e (patch)
tree400e6e82a90619e6c87865beec9d6880cb5f286d /todolist/formatter.go
parent9f62f82025e4dd7fa3a0dfc50bb94704209e608c (diff)
parent7c24f39a0fc8bb07dc9db4f5fecd3468705b1e37 (diff)
Merge branch 'note' of github.com:NonerKao/todolist into note_patch_set
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 {