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

Function outputStatusText

apps/cli/internal/cli/status.go:330–369  ·  view source on GitHub ↗
(out statusOutput, w io.Writer)

Source from the content-addressed store, hash-verified

328}
329
330func outputStatusText(out statusOutput, w io.Writer) error {
331 r := getRenderer()
332
333 fmt.Fprintf(w, "%s %s\n", formatLabel("Task:", r), formatTaskID(out.ID, r))
334 fmt.Fprintf(w, "%s %s\n", formatLabel("Title:", r), out.Title)
335 fmt.Fprintf(w, "%s %s\n", formatLabel("Status:", r), formatStatus(out.Status, r))
336 printStatusOptionalField(w, "Priority", out.Priority, r)
337 printStatusOptionalField(w, "Effort", out.Effort, r)
338 if len(out.Tags) > 0 {
339 fmt.Fprintf(w, "%s %s\n", formatLabel("Tags:", r), strings.Join(out.Tags, ", "))
340 }
341 if out.Owner != "" {
342 fmt.Fprintf(w, "%s %s\n", formatLabel("Owner:", r), out.Owner)
343 }
344 if out.Parent != "" {
345 fmt.Fprintf(w, "%s %s\n", formatLabel("Parent:", r), out.Parent)
346 }
347 if out.Created != "" {
348 fmt.Fprintf(w, "%s %s\n", formatLabel("Created:", r), out.Created)
349 }
350 if len(out.Dependencies) > 0 {
351 fmt.Fprintf(w, "%s %s\n", formatLabel("Dependencies:", r), strings.Join(out.Dependencies, ", "))
352 }
353 if out.Blocked != nil {
354 if *out.Blocked {
355 fmt.Fprintf(w, "%s Yes (blocked by: %s)\n", formatLabel("Blocked:", r), strings.Join(out.BlockedBy, ", "))
356 } else {
357 fmt.Fprintf(w, "%s No\n", formatLabel("Blocked:", r))
358 }
359 }
360 if out.Group != "" {
361 fmt.Fprintf(w, "%s %s\n", formatLabel("Group:", r), out.Group)
362 }
363 if len(out.Children) > 0 {
364 fmt.Fprintf(w, "%s\n", formatLabel("Children:", r))
365 writeChildrenTree(w, out.Children, " ", r)
366 }
367 fmt.Fprintf(w, "%s %s\n", formatLabel("File:", r), formatDim(out.FilePath, r))
368 return nil
369}
370
371func writeChildrenTree(w io.Writer, children []statusChild, prefix string, r *lipgloss.Renderer) {
372 for i, child := range children {

Callers 2

runStatusSingleFunction · 0.85
outputStatusListTextFunction · 0.85

Calls 7

getRendererFunction · 0.85
formatLabelFunction · 0.85
formatTaskIDFunction · 0.85
formatStatusFunction · 0.85
printStatusOptionalFieldFunction · 0.85
writeChildrenTreeFunction · 0.85
formatDimFunction · 0.85

Tested by

no test coverage detected