fix: regression where all args became passthrough

Fixes #475
This commit is contained in:
Alec Thomas
2024-12-03 08:22:10 +11:00
parent 96647c30af
commit 81d0c29303
+2
View File
@@ -302,6 +302,7 @@ func hydrateTag(t *Tag, typ reflect.Type) error { //nolint: gocyclo
return fmt.Errorf("passthrough only makes sense for positional arguments or commands")
}
t.Passthrough = passthrough
if t.Passthrough {
passthroughMode := t.Get("passthrough")
switch passthroughMode {
case "partial":
@@ -311,6 +312,7 @@ func hydrateTag(t *Tag, typ reflect.Type) error { //nolint: gocyclo
default:
return fmt.Errorf("invalid passthrough mode %q, must be one of 'partial' or 'all'", passthroughMode)
}
}
return nil
}