MCPcopy Create free account
hub / github.com/driangle/taskmd / outputBoardText

Function outputBoardText

apps/cli/internal/cli/board.go:130–151  ·  view source on GitHub ↗
(gr *board.GroupResult, w io.Writer)

Source from the content-addressed store, hash-verified

128}
129
130func outputBoardText(gr *board.GroupResult, w io.Writer) error {
131 r := getRenderer()
132 for i, key := range gr.Keys {
133 tasks := gr.Groups[key]
134 if i > 0 {
135 fmt.Fprintln(w)
136 }
137 coloredHeading := formatHeading(key, boardGroupBy, r)
138 countSuffix := fmt.Sprintf(" (%d)", len(tasks))
139 header := coloredHeading + countSuffix
140 // Use plain key length for the separator (not colored string length)
141 separatorLen := len(key) + len(countSuffix)
142 fmt.Fprintln(w, header)
143 fmt.Fprintln(w, strings.Repeat("-", separatorLen))
144 for _, t := range tasks {
145 formattedID := formatTaskID(t.ID, r)
146 formattedTitle := formatTaskTitle(t.Title, string(t.Status), r)
147 fmt.Fprintf(w, " %s %s\n", formattedID, formattedTitle)
148 }
149 }
150 return nil
151}
152
153func outputBoardJSON(gr *board.GroupResult, w io.Writer) error {
154 return WriteJSON(w, board.ToJSON(gr))

Callers 1

runBoardFunction · 0.85

Calls 4

getRendererFunction · 0.85
formatHeadingFunction · 0.85
formatTaskIDFunction · 0.85
formatTaskTitleFunction · 0.85

Tested by

no test coverage detected