diff --git a/cli/cobra.go b/cli/cobra.go index 7cf7e810d9..41622064c7 100644 --- a/cli/cobra.go +++ b/cli/cobra.go @@ -116,7 +116,13 @@ type TopLevelCommand struct { // NewTopLevelCommand returns a new TopLevelCommand object func NewTopLevelCommand(cmd *cobra.Command, dockerCli *command.DockerCli, opts *cliflags.ClientOptions, flags *pflag.FlagSet) *TopLevelCommand { - return &TopLevelCommand{cmd, dockerCli, opts, flags, os.Args[1:]} + return &TopLevelCommand{ + cmd: cmd, + dockerCli: dockerCli, + opts: opts, + flags: flags, + args: os.Args[1:], + } } // SetArgs sets the args (default os.Args[:1] used to invoke the command