MCPcopy Index your code
hub / github.com/devopsctl/gitlabctl / validateFlagIntValue

Function validateFlagIntValue

cmd/flags_definers.go:461–472  ·  view source on GitHub ↗
(intSlice []int,
	cmd *cobra.Command, fName string)

Source from the content-addressed store, hash-verified

459}
460
461func validateFlagIntValue(intSlice []int,
462 cmd *cobra.Command, fName string) error {
463 fValue := getFlagInt(cmd, fName)
464 for _, v := range intSlice {
465 if fValue == v {
466 return nil
467 }
468 }
469 return fmt.Errorf("'%v' is not a recognized value of '%s' flag. "+
470 "Please choose from: [%s]\n",
471 fValue, fName, strings.Trim(strings.Join(strings.Split(fmt.Sprint(intSlice), " "), ","), "[]"))
472}
473
474func addPaginationFlags(cmd *cobra.Command) {
475 cmd.PersistentFlags().Int("page", 0, "Page of results to retrieve")

Callers 1

validateAccessLevelFlagFunction · 0.85

Calls 1

getFlagIntFunction · 0.85

Tested by

no test coverage detected