(intSlice []int, cmd *cobra.Command, fName string)
| 459 | } |
| 460 | |
| 461 | func 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 | |
| 474 | func addPaginationFlags(cmd *cobra.Command) { |
| 475 | cmd.PersistentFlags().Int("page", 0, "Page of results to retrieve") |
no test coverage detected