(#508) Fix --page and --page-size arguments #2949
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description Of Changes
This fixes
--page
and--page-size
. These arguments are inefficient because they require querying for all packages, and throw away everything but the page requested.Motivation and Context
When the list command was switched to use NuGet.Client libraries, support for
--page
and--page-size
was removedTesting
.\choco.exe search google --source=https://community.chocolatey.org/api/v2
, validate that about 248 packages are returned.\choco.exe search google --source=https://community.chocolatey.org/api/v2 --page=0
, validate that 25 packages are returned.\choco.exe search google --source=https://community.chocolatey.org/api/v2 --page=2
, validate that 25 packages are returned and that they are the different from--page=0
.\choco.exe search google --source=https://community.chocolatey.org/api/v2 --page=0 --page-size=100
, validate that 100 packages are returned.Operating Systems Testing
Change Types Made
Change Checklist
Related Issue
Part of #508
https://app.clickup.com/t/20540031/PROJ-449