From 41513e30517b303e3f0b14ece4ac7ede273d5663 Mon Sep 17 00:00:00 2001 From: Victor Vieux Date: Mon, 7 Nov 2016 17:43:11 -0800 Subject: [PATCH] support settings in docker plugins install Signed-off-by: Victor Vieux --- command/plugin/install.go | 9 +++++++-- command/plugin/set.go | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/command/plugin/install.go b/command/plugin/install.go index 3989a35ce6..eae0183671 100644 --- a/command/plugin/install.go +++ b/command/plugin/install.go @@ -18,16 +18,20 @@ type pluginOptions struct { name string grantPerms bool disable bool + args []string } func newInstallCommand(dockerCli *command.DockerCli) *cobra.Command { var options pluginOptions cmd := &cobra.Command{ - Use: "install [OPTIONS] PLUGIN", + Use: "install [OPTIONS] PLUGIN [KEY=VALUE...]", Short: "Install a plugin", - Args: cli.ExactArgs(1), // TODO: allow for set args + Args: cli.RequiresMinArgs(1), RunE: func(cmd *cobra.Command, args []string) error { options.name = args[0] + if len(args) > 1 { + options.args = args[1:] + } return runInstall(dockerCli, options) }, } @@ -75,6 +79,7 @@ func runInstall(dockerCli *command.DockerCli, opts pluginOptions) error { AcceptPermissionsFunc: acceptPrivileges(dockerCli, opts.name), // TODO: Rename PrivilegeFunc, it has nothing to do with privileges PrivilegeFunc: registryAuthFunc, + Args: opts.args, } if err := dockerCli.Client().PluginInstall(ctx, ref.String(), options); err != nil { return err diff --git a/command/plugin/set.go b/command/plugin/set.go index e58ea63bc0..5660523ed9 100644 --- a/command/plugin/set.go +++ b/command/plugin/set.go @@ -13,7 +13,7 @@ import ( func newSetCommand(dockerCli *command.DockerCli) *cobra.Command { cmd := &cobra.Command{ - Use: "set PLUGIN key1=value1 [key2=value2...]", + 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 {