@@ -22,10 +22,9 @@ import (
2222
2323// setupCommonRootCommand contains the setup common to
2424// SetupRootCommand and SetupPluginRootCommand.
25- func setupCommonRootCommand (rootCmd * cobra.Command ) (* cliflags.ClientOptions , * pflag.FlagSet , * cobra.Command ) {
26- flags := rootCmd .Flags ()
25+ func setupCommonRootCommand (rootCmd * cobra.Command ) (* cliflags.ClientOptions , * cobra.Command ) {
2726 opts := cliflags .NewClientOptions ()
28- opts .InstallFlags (flags )
27+ opts .InstallFlags (rootCmd . Flags () )
2928
3029 cobra .AddTemplateFunc ("add" , func (a , b int ) int { return a + b })
3130 cobra .AddTemplateFunc ("hasAliases" , hasAliases )
@@ -70,20 +69,20 @@ func setupCommonRootCommand(rootCmd *cobra.Command) (*cliflags.ClientOptions, *p
7069 }
7170 }
7271
73- return opts , flags , helpCommand
72+ return opts , helpCommand
7473}
7574
7675// SetupRootCommand sets default usage, help, and error handling for the
7776// root command.
78- func SetupRootCommand (rootCmd * cobra.Command ) (* cliflags.ClientOptions , * pflag. FlagSet , * cobra.Command ) {
77+ func SetupRootCommand (rootCmd * cobra.Command ) (opts * cliflags.ClientOptions , helpCmd * cobra.Command ) {
7978 rootCmd .SetVersionTemplate ("Docker version {{.Version}}\n " )
8079 return setupCommonRootCommand (rootCmd )
8180}
8281
8382// SetupPluginRootCommand sets default usage, help and error handling for a plugin root command.
8483func SetupPluginRootCommand (rootCmd * cobra.Command ) (* cliflags.ClientOptions , * pflag.FlagSet ) {
85- opts , flags , _ := setupCommonRootCommand (rootCmd )
86- return opts , flags
84+ opts , _ := setupCommonRootCommand (rootCmd )
85+ return opts , rootCmd . Flags ()
8786}
8887
8988// FlagErrorFunc prints an error message which matches the format of the
0 commit comments