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

Function PrintCommentTable

internal/cli/format.go:691–712  ·  view source on GitHub ↗
(comments []models.Comment)

Source from the content-addressed store, hash-verified

689}
690
691func PrintCommentTable(comments []models.Comment) {
692 if len(comments) == 0 {
693 fmt.Println("No comments.")
694 return
695 }
696
697 for i, c := range comments {
698 badge := c.CreatedBy
699 if c.Author != "" && c.Author != c.CreatedBy {
700 badge = c.Author + " (" + c.CreatedBy + ")"
701 }
702 edited := ""
703 if c.IsEdited() {
704 edited = " • edited"
705 }
706 fmt.Printf("💬 %s • %s via %s%s • id %s\n", badge, RelativeTime(c.CreatedAt), c.Source, edited, c.ID)
707 fmt.Println(CommentBodyForDisplay(c))
708 if i < len(comments)-1 {
709 fmt.Println()
710 }
711 }
712}

Callers 2

showCmdFunction · 0.92
commentsCmdFunction · 0.92

Calls 4

RelativeTimeFunction · 0.85
CommentBodyForDisplayFunction · 0.85
IsEditedMethod · 0.80
PrintfMethod · 0.80

Tested by

no test coverage detected