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

Function PrintLinkTable

internal/cli/format.go:633–650  ·  view source on GitHub ↗

PrintLinkTable prints item links in a formatted table.

(links []models.ItemLink)

Source from the content-addressed store, hash-verified

631
632// PrintLinkTable prints item links in a formatted table.
633func PrintLinkTable(links []models.ItemLink) {
634 if len(links) == 0 {
635 fmt.Println("No links found.")
636 return
637 }
638
639 w := tabwriter.NewWriter(os.Stdout, 0, 0, 2, ' ', 0)
640 fmt.Fprintf(w, "TYPE\tSOURCE\tTARGET\tCREATED\n")
641 for _, link := range links {
642 fmt.Fprintf(w, "%s\t%s\t%s\t%s\n",
643 link.LinkType,
644 link.SourceTitle,
645 link.TargetTitle,
646 RelativeTime(link.CreatedAt),
647 )
648 }
649 w.Flush()
650}
651
652// PrintActivityTable prints activity entries in a table.
653func PrintActivityTable(activities []models.Activity) {

Callers

nothing calls this directly

Calls 2

RelativeTimeFunction · 0.85
FlushMethod · 0.45

Tested by

no test coverage detected