From ea18c73f11ebfbcabe07e5247ae49904d8620c19 Mon Sep 17 00:00:00 2001 From: Connor Hindley Date: Wed, 17 Nov 2021 11:01:40 -0700 Subject: [PATCH] Only prepend EnvPrefix if .Env is not empty. Before this change the EnvPrefix was applied to fields without env specified, which resulted in strange and confusing help output. --- build.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build.go b/build.go index aa5a143..3e8be10 100644 --- a/build.go +++ b/build.go @@ -139,7 +139,9 @@ MAIN: name = tag.Prefix + name } - tag.Env = tag.EnvPrefix + tag.Env + if tag.Env != "" { + tag.Env = tag.EnvPrefix + tag.Env + } // Nested structs are either commands or args, unless they implement the Mapper interface. if field.value.Kind() == reflect.Struct && (tag.Cmd || tag.Arg) && k.registry.ForValue(fv) == nil {