(dockerCli command.Cli)
| 88 | } |
| 89 | |
| 90 | func 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 | |
| 109 | func displayTransformer(dockerCli command.Cli, transformers []image.Summary, options lsOptions) error { |
| 110 | if options.Quiet { |
no test coverage detected