(parameter parser.Parameter, context *CommandExecContext, config config.Config)
| 195 | } |
| 196 | |
| 197 | func (b CommandBuilder) getValue(parameter parser.Parameter, context *CommandExecContext, config config.Config) string { |
| 198 | value := context.String(parameter.Name) |
| 199 | if value != "" { |
| 200 | return value |
| 201 | } |
| 202 | valueSlice := context.StringSlice(parameter.Name) |
| 203 | if len(valueSlice) > 0 { |
| 204 | return strings.Join(valueSlice, ",") |
| 205 | } |
| 206 | configValue := config.Parameter[parameter.Name] |
| 207 | if configValue != "" { |
| 208 | return configValue |
| 209 | } |
| 210 | if parameter.DefaultValue != nil { |
| 211 | return fmt.Sprint(parameter.DefaultValue) |
| 212 | } |
| 213 | return "" |
| 214 | } |
| 215 | |
| 216 | func (b CommandBuilder) validateArguments(context *CommandExecContext, parameters []parser.Parameter, config config.Config) error { |
| 217 | err := errors.New("Invalid arguments:") |
no test coverage detected