MCPcopy Create free account
hub / github.com/UiPath/uipathcli / getValue

Method getValue

commandline/command_builder.go:197–214  ·  view source on GitHub ↗
(parameter parser.Parameter, context *CommandExecContext, config config.Config)

Source from the content-addressed store, hash-verified

195}
196
197func (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
216func (b CommandBuilder) validateArguments(context *CommandExecContext, parameters []parser.Parameter, config config.Config) error {
217 err := errors.New("Invalid arguments:")

Callers 1

validateArgumentsMethod · 0.95

Calls 1

StringMethod · 0.80

Tested by

no test coverage detected