MCPcopy
hub / github.com/docker/compose / listTransformersCommand

Function listTransformersCommand

cmd/compose/bridge.go:90–107  ·  view source on GitHub ↗
(dockerCli command.Cli)

Source from the content-addressed store, hash-verified

88}
89
90func listTransformersCommand(dockerCli command.Cli) *cobra.Command {
91 options := lsOptions{}
92 cmd := &cobra.Command{
93 Use: "list",
94 Aliases: []string{"ls"},
95 Short: "List available transformations",
96 RunE: Adapt(func(ctx context.Context, args []string) error {
97 transformers, err := bridge.ListTransformers(ctx, dockerCli)
98 if err != nil {
99 return err
100 }
101 return displayTransformer(dockerCli, transformers, options)
102 }),
103 }
104 cmd.Flags().StringVar(&options.Format, "format", "table", "Format the output. Values: [table | json]")
105 cmd.Flags().BoolVarP(&options.Quiet, "quiet", "q", false, "Only display transformer names")
106 return cmd
107}
108
109func displayTransformer(dockerCli command.Cli, transformers []image.Summary, options lsOptions) error {
110 if options.Quiet {

Callers 1

transformersCommandFunction · 0.85

Calls 3

ListTransformersFunction · 0.92
AdaptFunction · 0.85
displayTransformerFunction · 0.85

Tested by

no test coverage detected