(dockerCLI command.Cli)
| 10 | ) |
| 11 | |
| 12 | func 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 | } |
searching dependent graphs…