feat: Placeholder string interpolation. (#510)
Add support string interpolation in placeholder values.
This commit is contained in:
@@ -270,6 +270,11 @@ func (k *Kong) interpolateValue(value *Value, vars Vars) (err error) {
|
||||
if len(value.Flag.Envs) != 0 {
|
||||
updatedVars["env"] = value.Flag.Envs[0]
|
||||
}
|
||||
|
||||
value.Flag.PlaceHolder, err = interpolate(value.Flag.PlaceHolder, vars, updatedVars)
|
||||
if err != nil {
|
||||
return fmt.Errorf("placeholder value for %s: %s", value.Summary(), err)
|
||||
}
|
||||
}
|
||||
value.Help, err = interpolate(value.Help, vars, updatedVars)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user