in cli_flag_assigned_variables.go [28:45]
func (v CliFlagAssignedVariable) Variables(c *BaseConfig) (map[string]VariableValueRead, error) {
variableBlocks := Blocks[*VariableBlock](c)
variables := make(map[string]*VariableBlock)
for _, vb := range variableBlocks {
variables[vb.Name()] = vb
}
vb, ok := variables[v.varName]
if !ok {
if c.ignoreUnknownVariables {
return map[string]VariableValueRead{}, nil
}
return nil, fmt.Errorf(`a variable named "%s" was assigned on the command line, but cannot find a variable of that name. To use this value, add a "variable" block to the configuraion`, v.varName)
}
read := vb.parseVariableValueFromString(v.rawValue, false)
return map[string]VariableValueRead{
read.Name: read,
}, nil
}