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

Function newDisableCommand

cli/command/plugin/disable.go:12–34  ·  view source on GitHub ↗
(dockerCLI command.Cli)

Source from the content-addressed store, hash-verified

10)
11
12func newDisableCommand(dockerCLI command.Cli) *cobra.Command {
13 var opts client.PluginDisableOptions
14
15 cmd := &cobra.Command{
16 Use: "disable [OPTIONS] PLUGIN",
17 Short: "Disable a plugin",
18 Args: cli.ExactArgs(1),
19 RunE: func(cmd *cobra.Command, args []string) error {
20 name := args[0]
21 if _, err := dockerCLI.Client().PluginDisable(cmd.Context(), name, opts); err != nil {
22 return err
23 }
24 _, _ = fmt.Fprintln(dockerCLI.Out(), name)
25 return nil
26 },
27 ValidArgsFunction: completeNames(dockerCLI, stateEnabled),
28 DisableFlagsInUseLine: true,
29 }
30
31 flags := cmd.Flags()
32 flags.BoolVarP(&opts.Force, "force", "f", false, "Force the disable of an active plugin")
33 return cmd
34}

Callers 3

TestPluginDisableErrorsFunction · 0.85
TestPluginDisableFunction · 0.85
newPluginCommandFunction · 0.85

Calls 4

PluginDisableMethod · 0.80
completeNamesFunction · 0.70
ClientMethod · 0.65
OutMethod · 0.65

Tested by 2

TestPluginDisableErrorsFunction · 0.68
TestPluginDisableFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…