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

Method createConfigSetCommand

commandline/command_builder.go:600–624  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

598}
599
600func (b CommandBuilder) createConfigSetCommand() *CommandDefinition {
601 const flagNameKey = "key"
602 const flagNameValue = "value"
603
604 flags := NewFlagBuilder().
605 AddFlag(NewFlag(flagNameKey, "The key\n\n"+b.configSetKeyAllowedValues(), FlagTypeString).
606 WithRequired(true)).
607 AddFlag(NewFlag(flagNameValue, "The value to set", FlagTypeString).
608 WithRequired(true)).
609 AddFlag(NewFlag(FlagNameProfile, "Profile to configure", FlagTypeString).
610 WithEnvVarName("UIPATH_PROFILE").
611 WithDefaultValue(config.DefaultProfile)).
612 AddHelpFlag().
613 Build()
614
615 return NewCommand("set", "Set config parameters", "Set config parameters").
616 WithFlags(flags).
617 WithAction(func(context *CommandExecContext) error {
618 profileName := context.String(FlagNameProfile)
619 key := context.String(flagNameKey)
620 value := context.String(flagNameValue)
621 handler := newConfigCommandHandler(b.StdIn, b.StdOut, b.ConfigProvider)
622 return handler.Set(key, value, profileName)
623 })
624}
625
626func (b CommandBuilder) configSetKeyAllowedValues() string {
627 builder := strings.Builder{}

Callers 1

createConfigCommandMethod · 0.95

Calls 15

NewFlagBuilderFunction · 0.85
NewFlagFunction · 0.85
newConfigCommandHandlerFunction · 0.85
AddHelpFlagMethod · 0.80
AddFlagMethod · 0.80
WithEnvVarNameMethod · 0.80
WithActionMethod · 0.80
WithFlagsMethod · 0.80
StringMethod · 0.80
NewCommandFunction · 0.70
SetMethod · 0.65

Tested by

no test coverage detected