@@ -302,14 +302,16 @@ func hydrateTag(t *Tag, typ reflect.Type) error { //nolint: gocyclo
|
|||||||
return fmt.Errorf("passthrough only makes sense for positional arguments or commands")
|
return fmt.Errorf("passthrough only makes sense for positional arguments or commands")
|
||||||
}
|
}
|
||||||
t.Passthrough = passthrough
|
t.Passthrough = passthrough
|
||||||
passthroughMode := t.Get("passthrough")
|
if t.Passthrough {
|
||||||
switch passthroughMode {
|
passthroughMode := t.Get("passthrough")
|
||||||
case "partial":
|
switch passthroughMode {
|
||||||
t.PassthroughMode = PassThroughModePartial
|
case "partial":
|
||||||
case "all", "":
|
t.PassthroughMode = PassThroughModePartial
|
||||||
t.PassthroughMode = PassThroughModeAll
|
case "all", "":
|
||||||
default:
|
t.PassthroughMode = PassThroughModeAll
|
||||||
return fmt.Errorf("invalid passthrough mode %q, must be one of 'partial' or 'all'", passthroughMode)
|
default:
|
||||||
|
return fmt.Errorf("invalid passthrough mode %q, must be one of 'partial' or 'all'", passthroughMode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user