From 79a75da0fd97b02311676028c3406b242c785f7c Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Fri, 26 Apr 2019 15:09:09 +0100 Subject: [PATCH] Hide experimental builtin commands in help output on unknown flag. Previously `docker --badopt` would always include experimental commands even if experimental was not enabled. Signed-off-by: Ian Campbell --- cmd/docker/docker.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/docker/docker.go b/cmd/docker/docker.go index 22b978de9b..f522a29a03 100644 --- a/cmd/docker/docker.go +++ b/cmd/docker/docker.go @@ -79,6 +79,9 @@ func setFlagErrorFunc(dockerCli *command.DockerCli, cmd *cobra.Command) { if err := isSupported(cmd, dockerCli); err != nil { return err } + if err := hideUnsupportedFeatures(cmd, dockerCli); err != nil { + return err + } return flagErrorFunc(cmd, err) }) }