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

Function newUpdateCommand

cli/command/context/update.go:34–51  ·  view source on GitHub ↗
(dockerCLI command.Cli)

Source from the content-addressed store, hash-verified

32}
33
34func newUpdateCommand(dockerCLI command.Cli) *cobra.Command {
35 opts := updateOptions{}
36 cmd := &cobra.Command{
37 Use: "update [OPTIONS] CONTEXT",
38 Short: "Update a context",
39 Args: cli.ExactArgs(1),
40 RunE: func(cmd *cobra.Command, args []string) error {
41 return runUpdate(dockerCLI, args[0], opts)
42 },
43 Long: longUpdateDescription(),
44 ValidArgsFunction: completeContextNames(dockerCLI, 1, false),
45 DisableFlagsInUseLine: true,
46 }
47 flags := cmd.Flags()
48 flags.StringVar(&opts.description, "description", "", "Description of the context")
49 flags.StringToStringVar(&opts.endpoint, "docker", nil, "set the docker endpoint")
50 return cmd
51}
52
53// runUpdate updates a Docker context.
54func runUpdate(dockerCLI command.Cli, name string, opts updateOptions) error {

Callers 1

newContextCommandFunction · 0.70

Calls 3

longUpdateDescriptionFunction · 0.85
runUpdateFunction · 0.70
completeContextNamesFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…