More enum fixes.

This commit is contained in:
Alec Thomas
2021-12-13 18:54:06 +11:00
parent fa08e7027c
commit 9c9b8ab50b
5 changed files with 104 additions and 47 deletions
+2
View File
@@ -186,6 +186,8 @@ func hydrateTag(t *Tag, typ reflect.Type) error { // nolint: gocyclo
// Arguments with defaults are always optional.
if t.Arg && t.Default != "" {
t.Optional = true
} else if t.Arg && !optional { // Arguments are required unless explicitly made optional.
t.Required = true
}
t.Name = t.Get("name")
t.Help = t.Get("help")