Merge pull request #10332 from iamazeem/10260-gh-api-notifications-slurp-flag

[gh api] Fix mutual exclusion messages of `--slurp` flag
This commit is contained in:
Kynan Ware 2025-02-01 12:36:26 -07:00 committed by GitHub
commit 88e744bafb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -239,17 +239,19 @@ func NewCmdApi(f *cmdutil.Factory, runF func(*ApiOptions) error) *cobra.Command
return err
}
if opts.Slurp && !opts.Paginate {
return cmdutil.FlagErrorf("`--paginate` required when passing `--slurp`")
}
if opts.Slurp {
if err := cmdutil.MutuallyExclusive(
"the `--slurp` option is not supported with `--jq` or `--template`",
opts.Slurp,
opts.FilterOutput != "",
opts.Template != "",
); err != nil {
return err
}
if err := cmdutil.MutuallyExclusive(
"the `--slurp` option is not supported with `--jq` or `--template`",
opts.Slurp,
opts.FilterOutput != "",
opts.Template != "",
); err != nil {
return err
if !opts.Paginate {
return cmdutil.FlagErrorf("`--paginate` required when passing `--slurp`")
}
}
if err := cmdutil.MutuallyExclusive(