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

Function outputStatusListFormatted

apps/cli/internal/cli/status.go:151–174  ·  view source on GitHub ↗
(tasks, filtered []*model.Task)

Source from the content-addressed store, hash-verified

149}
150
151func outputStatusListFormatted(tasks, filtered []*model.Task) error {
152 var childrenIndex map[string][]*model.Task
153 if !statusMinimal {
154 childrenIndex = buildChildrenIndex(tasks)
155 }
156
157 tasksByID := buildTasksByIDMap(tasks)
158
159 outputs := make([]statusOutput, 0, len(filtered))
160 for _, task := range filtered {
161 outputs = append(outputs, buildStatusOutputFromTask(task, childrenIndex, tasksByID))
162 }
163
164 switch statusFormat {
165 case "text":
166 return outputStatusListText(outputs, os.Stdout)
167 case "json":
168 return WriteJSON(os.Stdout, outputs)
169 case "yaml":
170 return WriteYAML(os.Stdout, outputs)
171 default:
172 return fmt.Errorf("unsupported format: %s (supported: text, json, yaml)", statusFormat)
173 }
174}
175
176func runStatusSingle(query string) error {
177 flags := GetGlobalFlags()

Callers 1

runStatusListFunction · 0.85

Calls 6

buildChildrenIndexFunction · 0.85
buildTasksByIDMapFunction · 0.85
outputStatusListTextFunction · 0.85
WriteJSONFunction · 0.85
WriteYAMLFunction · 0.85

Tested by

no test coverage detected