From 4758c92085bd3786851ad767671118abed02d48c Mon Sep 17 00:00:00 2001 From: Vincent Demeester Date: Thu, 22 Mar 2018 15:13:04 +0100 Subject: [PATCH] Use HasAvailableFlags instead of HasFlags for Options in help > HasAvailableFlags checks if the command contains any flags (local > plus persistent from the entire structure) which are not hidden or > deprecated. This fix the `--help` display when the `Options` is empty (but showing), like on `docker trust key` Signed-off-by: Vincent Demeester Upstream-commit: 66fdd085a51f2725a8b58c0203f0a544a169950c Component: cli --- components/cli/cli/cobra.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/cli/cli/cobra.go b/components/cli/cli/cobra.go index 3a5691a8c3..e97abd2a1b 100644 --- a/components/cli/cli/cobra.go +++ b/components/cli/cli/cobra.go @@ -128,7 +128,7 @@ Examples: {{ .Example }} {{- end}} -{{- if .HasFlags}} +{{- if .HasAvailableFlags}} Options: {{ wrappedFlagUsages . | trimRightSpace}}