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

Function registerBool

internal/cli/flags.go:418–434  ·  view source on GitHub ↗
(cmd *cobra.Command, f *Flag, value *bool, defaultValue bool, isUpdate bool)

Source from the content-addressed store, hash-verified

416}
417
418func registerBool(cmd *cobra.Command, f *Flag, value *bool, defaultValue bool, isUpdate bool) {
419 cmd.Flags().BoolVarP(value, f.LongForm, f.ShortForm, defaultValue, f.Help)
420
421 // Set up flag aliases if specified.
422 if len(f.AlsoKnownAs) > 0 {
423 flag := cmd.Flags().Lookup(f.LongForm)
424 if flag != nil {
425 for _, alias := range f.AlsoKnownAs {
426 cmd.Flags().BoolVar(value, alias, defaultValue, f.Help)
427 }
428 }
429 }
430
431 if err := markFlagRequired(cmd, f, isUpdate); err != nil {
432 panic(auth0.Error(err, "failed to register bool flag"))
433 }
434}
435
436func shouldAsk(cmd *cobra.Command, f *Flag, isUpdate bool) bool {
437 if isUpdate {

Callers 2

RegisterBoolMethod · 0.85
RegisterBoolUMethod · 0.85

Calls 2

ErrorFunction · 0.92
markFlagRequiredFunction · 0.85

Tested by

no test coverage detected