-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Expand file tree
/
Copy pathset.go
More file actions
24 lines (22 loc) · 704 Bytes
/
set.go
File metadata and controls
24 lines (22 loc) · 704 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package plugin
import (
"github.com/docker/cli/cli"
"github.com/docker/cli/cli/command"
"github.com/moby/moby/client"
"github.com/spf13/cobra"
)
func newSetCommand(dockerCLI command.Cli) *cobra.Command {
return &cobra.Command{
Use: "set PLUGIN KEY=VALUE [KEY=VALUE...]",
Short: "Change settings for a plugin",
Args: cli.RequiresMinArgs(2),
RunE: func(cmd *cobra.Command, args []string) error {
_, err := dockerCLI.Client().PluginSet(cmd.Context(), args[0], client.PluginSetOptions{
Args: args[1:],
})
return err
},
ValidArgsFunction: completeNames(dockerCLI, stateAny), // TODO(thaJeztah): should only complete for the first arg
DisableFlagsInUseLine: true,
}
}