MCPcopy Index your code
hub / github.com/cli/cli / renderTable

Function renderTable

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

Source from the content-addressed store, hash-verified

504}
505
506func renderTable(io *iostreams.IOStreams, skills []listedSkill) error {
507 table := tableprinter.New(io, tableprinter.WithHeader("Name", "Agent", "Scope", "Source"))
508
509 for _, skill := range skills {
510 table.AddField(sanitizeForTerminal(skill.skillName))
511 table.AddField(formatAgentHosts(skill.agentHostIDs))
512 table.AddField(displayOrDash(skill.scope))
513 table.AddField(displayOrDash(sanitizeForTerminal(skill.source)))
514 table.EndRow()
515 }
516
517 return table.Render()
518}
519
520// sanitizeForTerminal replaces ASCII control characters in s with inert
521// 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