Skip to content

Commit e9e6311

Browse files
Add $ to env help
1 parent 3cfebdf commit e9e6311

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

builder.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,9 @@ func Command(obj Runnable, children ...any) *cobra.Command {
129129

130130
name, alias := name(fieldType.Name, fieldType.Tag.Get("name"), fieldType.Tag.Get("short"))
131131
usage := fieldType.Tag.Get("usage")
132+
if usage == "-" {
133+
continue
134+
}
132135
env := strings.Split(fieldType.Tag.Get("env"), ",")
133136
defValue := fieldType.Tag.Get("default")
134137
if len(env) == 1 && env[0] == "" {
@@ -140,7 +143,7 @@ func Command(obj Runnable, children ...any) *cobra.Command {
140143
}
141144

142145
if len(env) > 0 {
143-
usage += fmt.Sprintf(" (%s)", strings.Join(env, ","))
146+
usage += fmt.Sprintf(" ($%s)", strings.Join(env, ","))
144147
}
145148

146149
usage = strings.TrimSpace(usage)

0 commit comments

Comments
 (0)