(dockerCLI command.Cli)
| 32 | } |
| 33 | |
| 34 | func 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. |
| 54 | func runUpdate(dockerCLI command.Cli, name string, opts updateOptions) error { |
no test coverage detected
searching dependent graphs…