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

Function pickFlag

internal/cli/flags.go:222–245  ·  view source on GitHub ↗
(cmd *cobra.Command, f *Flag, result *string, fn pickerOptionsFunc, isUpdate bool)

Source from the content-addressed store, hash-verified

220}
221
222func pickFlag(cmd *cobra.Command, f *Flag, result *string, fn pickerOptionsFunc, isUpdate bool) error {
223 if shouldAsk(cmd, f, isUpdate) {
224 var opts pickerOptions
225 err := ansi.Waiting(func() error {
226 var err error
227 opts, err = fn(cmd.Context())
228 return err
229 })
230
231 if err != nil {
232 return err
233 }
234
235 defaultLabel := opts.defaultLabel()
236 var val string
237 if err := selectFlag(cmd, f, &val, opts.labels(), &defaultLabel, isUpdate); err != nil {
238 return err
239 }
240
241 *result = opts.getValue(val)
242 }
243
244 return nil
245}
246
247func pickManyFlag(cmd *cobra.Command, f *Flag, result *[]string, fn pickerOptionsFunc) error {
248 if shouldAsk(cmd, f, false) {

Callers 2

PickMethod · 0.85
PickUMethod · 0.85

Calls 6

defaultLabelMethod · 0.95
labelsMethod · 0.95
getValueMethod · 0.95
WaitingFunction · 0.92
shouldAskFunction · 0.85
selectFlagFunction · 0.85

Tested by

no test coverage detected