(dockerCLI command.Cli)
| 18 | } |
| 19 | |
| 20 | func newRemoveCommand(dockerCLI command.Cli) *cobra.Command { |
| 21 | var opts rmOptions |
| 22 | |
| 23 | cmd := &cobra.Command{ |
| 24 | Use: "rm [OPTIONS] PLUGIN [PLUGIN...]", |
| 25 | Short: "Remove one or more plugins", |
| 26 | Aliases: []string{"remove"}, |
| 27 | Args: cli.RequiresMinArgs(1), |
| 28 | RunE: func(cmd *cobra.Command, args []string) error { |
| 29 | opts.plugins = args |
| 30 | return runRemove(cmd.Context(), dockerCLI, &opts) |
| 31 | }, |
| 32 | ValidArgsFunction: completeNames(dockerCLI, stateAny), |
| 33 | DisableFlagsInUseLine: true, |
| 34 | } |
| 35 | |
| 36 | flags := cmd.Flags() |
| 37 | flags.BoolVarP(&opts.force, "force", "f", false, "Force the removal of an active plugin") |
| 38 | return cmd |
| 39 | } |
| 40 | |
| 41 | func runRemove(ctx context.Context, dockerCLI command.Cli, opts *rmOptions) error { |
| 42 | apiClient := dockerCLI.Client() |
searching dependent graphs…