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

Function PrintCommentTable

internal/cli/format.go:576–593  ·  view source on GitHub ↗

PrintCommentTable prints comments in a formatted table.

(comments []models.Comment)

Source from the content-addressed store, hash-verified

574
575// PrintCommentTable prints comments in a formatted table.
576func PrintCommentTable(comments []models.Comment) {
577 if len(comments) == 0 {
578 fmt.Println("No comments.")
579 return
580 }
581
582 for i, c := range comments {
583 badge := c.CreatedBy
584 if c.Author != "" && c.Author != c.CreatedBy {
585 badge = c.Author + " (" + c.CreatedBy + ")"
586 }
587 fmt.Printf("💬 %s • %s via %s\n", badge, RelativeTime(c.CreatedAt), c.Source)
588 fmt.Println(c.Body)
589 if i < len(comments)-1 {
590 fmt.Println()
591 }
592 }
593}

Callers 2

showCmdFunction · 0.92
commentsCmdFunction · 0.92

Calls 1

RelativeTimeFunction · 0.85

Tested by

no test coverage detected