(dockerCLI command.Cli)
| 16 | } |
| 17 | |
| 18 | func newSecretRemoveCommand(dockerCLI command.Cli) *cobra.Command { |
| 19 | return &cobra.Command{ |
| 20 | Use: "rm SECRET [SECRET...]", |
| 21 | Aliases: []string{"remove"}, |
| 22 | Short: "Remove one or more secrets", |
| 23 | Args: cli.RequiresMinArgs(1), |
| 24 | RunE: func(cmd *cobra.Command, args []string) error { |
| 25 | opts := removeOptions{ |
| 26 | names: args, |
| 27 | } |
| 28 | return runRemove(cmd.Context(), dockerCLI, opts) |
| 29 | }, |
| 30 | ValidArgsFunction: completeNames(dockerCLI), |
| 31 | DisableFlagsInUseLine: true, |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | func runRemove(ctx context.Context, dockerCLI command.Cli, opts removeOptions) error { |
| 36 | apiClient := dockerCLI.Client() |
searching dependent graphs…