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

Function newRemoveCommand

cli/command/plugin/remove.go:20–39  ·  view source on GitHub ↗
(dockerCLI command.Cli)

Source from the content-addressed store, hash-verified

18}
19
20func 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
41func runRemove(ctx context.Context, dockerCLI command.Cli, opts *rmOptions) error {
42 apiClient := dockerCLI.Client()

Callers 4

newPluginCommandFunction · 0.70
TestRemoveErrorsFunction · 0.70
TestRemoveFunction · 0.70

Calls 2

runRemoveFunction · 0.70
completeNamesFunction · 0.70

Tested by 3

TestRemoveErrorsFunction · 0.56
TestRemoveFunction · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…