MCPcopy Create free account
hub / github.com/auth0/auth0-cli / PickMany

Method PickMany

internal/cli/arguments.go:65–88  ·  view source on GitHub ↗
(cmd *cobra.Command, result *[]string, fn pickerOptionsFunc)

Source from the content-addressed store, hash-verified

63}
64
65func (a *Argument) PickMany(cmd *cobra.Command, result *[]string, fn pickerOptionsFunc) error {
66 if !canPrompt(cmd) {
67 return fmt.Errorf("missing a required argument: %s", a.GetName())
68 }
69
70 var opts pickerOptions
71 err := ansi.Waiting(func() error {
72 var err error
73 opts, err = fn(cmd.Context())
74 return err
75 })
76
77 if err != nil {
78 return err
79 }
80
81 var values []string
82 if err := askMultiSelect(a, &values, opts.labels()...); err != nil {
83 return err
84 }
85
86 *result = opts.getValues(values...)
87 return nil
88}
89
90func askArgument(cmd *cobra.Command, i commandInput, value interface{}) error {
91 if canPrompt(cmd) {

Callers

nothing calls this directly

Calls 7

GetNameMethod · 0.95
labelsMethod · 0.95
getValuesMethod · 0.95
WaitingFunction · 0.92
canPromptFunction · 0.85
askMultiSelectFunction · 0.85
ErrorfMethod · 0.80

Tested by

no test coverage detected