MCPcopy Create free account
hub / github.com/chainloop-dev/chainloop / pluginListTableOutput

Function pluginListTableOutput

app/cli/cmd/plugins.go:361–381  ·  view source on GitHub ↗

Table output functions

(plugins map[string]*plugins.LoadedPlugin)

Source from the content-addressed store, hash-verified

359
360// Table output functions
361func pluginListTableOutput(plugins map[string]*plugins.LoadedPlugin) {
362 if len(plugins) == 0 {
363 fmt.Println("No plugins installed")
364 return
365 }
366
367 t := output.NewTableWriter()
368 t.AppendHeader(table.Row{"Name", "Version", "Description", "Commands"})
369
370 for name, plugin := range plugins {
371 commandStr := fmt.Sprintf("%d command(s)", len(plugin.Metadata.Commands))
372 if len(plugin.Metadata.Commands) == 0 {
373 commandStr = "no commands"
374 }
375
376 t.AppendRow(table.Row{name, plugin.Metadata.Version, plugin.Metadata.Description, commandStr})
377 t.AppendSeparator()
378 }
379
380 t.Render()
381}
382
383func pluginInfoTableOutput(plugin *plugins.LoadedPlugin) {
384 t := output.NewTableWriter()

Callers 1

newPluginListCmdFunction · 0.85

Calls 2

NewTableWriterFunction · 0.92
RenderMethod · 0.80

Tested by

no test coverage detected