MCPcopy Create free account
hub / github.com/cli/cli / renderTable

Function renderTable

pkg/cmd/skills/list/list.go:500–512  ·  view source on GitHub ↗
(io *iostreams.IOStreams, skills []listedSkill)

Source from the content-addressed store, hash-verified

498}
499
500func renderTable(io *iostreams.IOStreams, skills []listedSkill) error {
501 table := tableprinter.New(io, tableprinter.WithHeader("Name", "Agent", "Scope", "Source"))
502
503 for _, skill := range skills {
504 table.AddField(sanitizeForTerminal(skill.skillName))
505 table.AddField(formatAgentHosts(skill.agentHostIDs))
506 table.AddField(displayOrDash(skill.scope))
507 table.AddField(displayOrDash(sanitizeForTerminal(skill.source)))
508 table.EndRow()
509 }
510
511 return table.Render()
512}
513
514// sanitizeForTerminal replaces ASCII control characters in s with inert
515// caret-style stand-ins so frontmatter values cannot inject terminal escapes.

Callers 2

listRunFunction · 0.70

Calls 6

NewFunction · 0.92
WithHeaderFunction · 0.92
sanitizeForTerminalFunction · 0.85
formatAgentHostsFunction · 0.85
displayOrDashFunction · 0.85
RenderMethod · 0.65

Tested by 1