Ver código fonte

Do not show value on boolean flags help.

Mariano Cano 7 anos atrás
pai
commit
00ebee870b
1 arquivos alterados com 5 adições e 1 exclusões
  1. 5 1
      cmd/step-ca/main.go

+ 5 - 1
cmd/step-ca/main.go

@@ -226,7 +226,11 @@ func stringifyFlag(f cli.Flag) string {
 	usage := fv.FieldByName("Usage").String()
 	placeholder := placeholderString.FindString(usage)
 	if placeholder == "" {
-		placeholder = "<value>"
+		switch f.(type) {
+		case cli.BoolFlag, cli.BoolTFlag:
+		default:
+			placeholder = "<value>"
+		}
 	}
 	return cli.FlagNamePrefixer(fv.FieldByName("Name").String(), placeholder) + "\t" + usage
 }