MM-56632 Display warning if requested mage size exceeds max (#26022) (#27216)

Этот коммит содержится в:
Seth Foss
2024-11-06 09:45:56 -05:00
коммит произвёл GitHub
родитель efa93a3dd3
Коммит 2117a4ed30
2 изменённых файлов: 6 добавлений и 0 удалений

Просмотреть файл

@@ -108,6 +108,11 @@ var RootCmd = &cobra.Command{
}
quiet := viper.GetBool("quiet")
printer.SetQuiet(quiet)
perPage, err := cmd.Flags().GetInt("per-page")
if err == nil && perPage > MaxPageSize {
printer.PrintError(fmt.Sprintf("Per page value is greater than the maximum allowed. Mattermost might only return %d items.", MaxPageSize))
}
},
PersistentPostRun: func(cmd *cobra.Command, args []string) {
_ = printer.Flush()

Просмотреть файл

@@ -16,6 +16,7 @@ import (
const (
DefaultPageSize = 200
MaxPageSize = 200
)
func checkInteractiveTerminal() error {