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

Function runList

cli/command/plugin/list.go:49–76  ·  view source on GitHub ↗
(ctx context.Context, dockerCli command.Cli, options listOptions)

Source from the content-addressed store, hash-verified

47}
48
49func runList(ctx context.Context, dockerCli command.Cli, options listOptions) error {
50 resp, err := dockerCli.Client().PluginList(ctx, client.PluginListOptions{
51 Filters: options.filter.Value(),
52 })
53 if err != nil {
54 return err
55 }
56
57 sort.Slice(resp.Items, func(i, j int) bool {
58 return sortorder.NaturalLess(resp.Items[i].Name, resp.Items[j].Name)
59 })
60
61 format := options.format
62 if len(format) == 0 {
63 if len(dockerCli.ConfigFile().PluginsFormat) > 0 && !options.quiet {
64 format = dockerCli.ConfigFile().PluginsFormat
65 } else {
66 format = formatter.TableFormatKey
67 }
68 }
69
70 pluginsCtx := formatter.Context{
71 Output: dockerCli.Out(),
72 Format: newFormat(format, options.quiet),
73 Trunc: !options.noTrunc,
74 }
75 return formatWrite(pluginsCtx, resp)
76}

Callers 1

newListCommandFunction · 0.70

Calls 7

PluginListMethod · 0.80
newFormatFunction · 0.70
formatWriteFunction · 0.70
ClientMethod · 0.65
ValueMethod · 0.65
ConfigFileMethod · 0.65
OutMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…