From 66fdd085a51f2725a8b58c0203f0a544a169950c 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 --- cli/cobra.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/cobra.go b/cli/cobra.go index 3a5691a8c3..e97abd2a1b 100644 --- a/cli/cobra.go +++ b/cli/cobra.go @@ -128,7 +128,7 @@ Examples: {{ .Example }} {{- end}} -{{- if .HasFlags}} +{{- if .HasAvailableFlags}} Options: {{ wrappedFlagUsages . | trimRightSpace}}