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

Function registerIntSlice

internal/cli/flags.go:364–380  ·  view source on GitHub ↗
(cmd *cobra.Command, f *Flag, value *[]int, defaultValue []int, isUpdate bool)

Source from the content-addressed store, hash-verified

362}
363
364func registerIntSlice(cmd *cobra.Command, f *Flag, value *[]int, defaultValue []int, isUpdate bool) {
365 cmd.Flags().IntSliceVarP(value, f.LongForm, f.ShortForm, defaultValue, f.Help)
366
367 // Set up flag aliases if specified.
368 if len(f.AlsoKnownAs) > 0 {
369 flag := cmd.Flags().Lookup(f.LongForm)
370 if flag != nil {
371 for _, alias := range f.AlsoKnownAs {
372 cmd.Flags().IntSliceVar(value, alias, defaultValue, f.Help)
373 }
374 }
375 }
376
377 if err := markFlagRequired(cmd, f, isUpdate); err != nil {
378 panic(auth0.Error(err, "failed to register int slice flag"))
379 }
380}
381
382func askIntSlice(i commandInput, value *[]int, defaultValue *[]int) error {
383 var strInput string

Callers 1

RegisterIntSliceMethod · 0.85

Calls 2

ErrorFunction · 0.92
markFlagRequiredFunction · 0.85

Tested by

no test coverage detected