MCPcopy Create free account
hub / github.com/PerpetualSoftware/pad / PrintActivityTable

Function PrintActivityTable

internal/cli/format.go:653–670  ·  view source on GitHub ↗

PrintActivityTable prints activity entries in a table.

(activities []models.Activity)

Source from the content-addressed store, hash-verified

651
652// PrintActivityTable prints activity entries in a table.
653func PrintActivityTable(activities []models.Activity) {
654 if len(activities) == 0 {
655 fmt.Println("No recent activity.")
656 return
657 }
658
659 w := tabwriter.NewWriter(os.Stdout, 0, 0, 2, ' ', 0)
660 fmt.Fprintf(w, "ACTION\tACTOR\tSOURCE\tWHEN\n")
661 for _, a := range activities {
662 fmt.Fprintf(w, "%s\t%s\t%s\t%s\n",
663 a.Action,
664 a.Actor,
665 a.Source,
666 RelativeTime(a.CreatedAt),
667 )
668 }
669 w.Flush()
670}
671
672// PrintCommentTable prints comments in a formatted table.
673// PrintCommentTable deliberately does NOT render Comment.AgentName (TASK-2760).

Callers

nothing calls this directly

Calls 2

RelativeTimeFunction · 0.85
FlushMethod · 0.45

Tested by

no test coverage detected