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

Function newRemoveCommand

cli/command/context/remove.go:18–33  ·  view source on GitHub ↗
(dockerCLI command.Cli)

Source from the content-addressed store, hash-verified

16}
17
18func newRemoveCommand(dockerCLI command.Cli) *cobra.Command {
19 var opts removeOptions
20 cmd := &cobra.Command{
21 Use: "rm CONTEXT [CONTEXT...]",
22 Aliases: []string{"remove"},
23 Short: "Remove one or more contexts",
24 Args: cli.RequiresMinArgs(1),
25 RunE: func(cmd *cobra.Command, args []string) error {
26 return runRemove(dockerCLI, opts, args)
27 },
28 ValidArgsFunction: completeContextNames(dockerCLI, -1, false),
29 DisableFlagsInUseLine: true,
30 }
31 cmd.Flags().BoolVarP(&opts.force, "force", "f", false, "Force the removal of a context in use")
32 return cmd
33}
34
35// runRemove removes one or more contexts.
36func runRemove(dockerCLI command.Cli, opts removeOptions, names []string) error {

Callers 1

newContextCommandFunction · 0.70

Calls 2

runRemoveFunction · 0.70
completeContextNamesFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…