From d67aa065ef9f295949ed507fc3d67f29fd56fcdb Mon Sep 17 00:00:00 2001 From: John Stephens Date: Fri, 11 Nov 2016 17:43:06 -0800 Subject: [PATCH] Show experimental flags and subcommands if enabled Signed-off-by: John Stephens --- cmd/docker/docker.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/cmd/docker/docker.go b/cmd/docker/docker.go index 1978fc33bc..02d2918f0c 100644 --- a/cmd/docker/docker.go +++ b/cmd/docker/docker.go @@ -126,8 +126,10 @@ func dockerPreRun(opts *cliflags.ClientOptions) { func hideUnsupportedFeatures(cmd *cobra.Command, clientVersion string, hasExperimental bool) { cmd.Flags().VisitAll(func(f *pflag.Flag) { // hide experimental flags - if _, ok := f.Annotations["experimental"]; ok { - f.Hidden = true + if !hasExperimental { + if _, ok := f.Annotations["experimental"]; ok { + f.Hidden = true + } } // hide flags not supported by the server @@ -139,8 +141,10 @@ func hideUnsupportedFeatures(cmd *cobra.Command, clientVersion string, hasExperi for _, subcmd := range cmd.Commands() { // hide experimental subcommands - if _, ok := subcmd.Tags["experimental"]; ok { - subcmd.Hidden = true + if !hasExperimental { + if _, ok := subcmd.Tags["experimental"]; ok { + subcmd.Hidden = true + } } // hide subcommands not supported by the server