MCPcopy Index your code
hub / github.com/docker/cli / newFormat

Function newFormat

cli/command/plugin/formatter.go:25–39  ·  view source on GitHub ↗

newFormat returns a Format for rendering using a pluginContext.

(source string, quiet bool)

Source from the content-addressed store, hash-verified

23
24// newFormat returns a Format for rendering using a pluginContext.
25func newFormat(source string, quiet bool) formatter.Format {
26 switch source {
27 case formatter.TableFormatKey:
28 if quiet {
29 return formatter.DefaultQuietFormat
30 }
31 return defaultPluginTableFormat
32 case formatter.RawFormatKey:
33 if quiet {
34 return `plugin_id: {{.ID}}`
35 }
36 return rawFormat
37 }
38 return formatter.Format(source)
39}
40
41// formatWrite writes the context
42func formatWrite(fmtCtx formatter.Context, plugins client.PluginListResult) error {

Callers 2

TestPluginContextWriteFunction · 0.70
runListFunction · 0.70

Calls

no outgoing calls

Tested by 1

TestPluginContextWriteFunction · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…