Do not add environment variable to help it is already present.

Fixes #246.
This commit is contained in:
Mitar
2021-12-03 00:19:54 +01:00
committed by Alec Thomas
parent 32b2f740c9
commit deebf0b09b
7 changed files with 30 additions and 5 deletions
+1 -1
View File
@@ -86,7 +86,7 @@ type HelpValueFormatter func(value *Value) string
// DefaultHelpValueFormatter is the default HelpValueFormatter.
func DefaultHelpValueFormatter(value *Value) string {
if value.Tag.Env == "" {
if value.Tag.Env == "" || HasInterpolatedVar(value.OrigHelp, "env") {
return value.Help
}
suffix := "($" + value.Tag.Env + ")"