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

Method createConfigCommand

commandline/command_builder.go:572–598  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

570}
571
572func (b CommandBuilder) createConfigCommand() *CommandDefinition {
573 const flagNameAuth = "auth"
574
575 flags := NewFlagBuilder().
576 AddFlag(NewFlag(flagNameAuth, fmt.Sprintf("Authorization type: %s, %s, %s", config.AuthTypeCredentials, config.AuthTypeLogin, config.AuthTypePat), FlagTypeString)).
577 AddFlag(NewFlag(FlagNameProfile, "Profile to configure", FlagTypeString).
578 WithEnvVarName("UIPATH_PROFILE").
579 WithDefaultValue(config.DefaultProfile)).
580 AddHelpFlag().
581 Build()
582
583 subcommands := []*CommandDefinition{
584 b.createConfigSetCommand(),
585 b.createCacheCommand(),
586 b.createOfflineCommand(),
587 }
588
589 return NewCommand("config", "Interactive Configuration", "Interactive command to configure the CLI").
590 WithFlags(flags).
591 WithSubcommands(subcommands).
592 WithAction(func(context *CommandExecContext) error {
593 auth := context.String(flagNameAuth)
594 profileName := context.String(FlagNameProfile)
595 handler := newConfigCommandHandler(b.StdIn, b.StdOut, b.ConfigProvider)
596 return handler.Configure(auth, profileName)
597 })
598}
599
600func (b CommandBuilder) createConfigSetCommand() *CommandDefinition {
601 const flagNameKey = "key"

Callers 1

CreateMethod · 0.95

Calls 15

createCacheCommandMethod · 0.95
createOfflineCommandMethod · 0.95
NewFlagBuilderFunction · 0.85
NewFlagFunction · 0.85
newConfigCommandHandlerFunction · 0.85
AddHelpFlagMethod · 0.80
AddFlagMethod · 0.80
WithEnvVarNameMethod · 0.80
WithActionMethod · 0.80
WithSubcommandsMethod · 0.80
WithFlagsMethod · 0.80

Tested by

no test coverage detected