Summary
Fixes the repo list and repo search --limit flag so it caps the total number of returned repositories instead of only changing the API page size.
Problem
The CLI currently maps --limit into PerPage for repository list/search options:
repo list --limit N sets ListRepoOpts.PerPage = N
repo search --limit N sets SearchRepoOpts.PerPage = N
This leaves Limit unset, so repository listing can keep fetching every page from the API instead of stopping at the requested number of results.
Expected behavior
--limit N should mean “return at most N repositories”.
Changes
- Map
repo list --limit to ListRepoOpts.Limit.
- Map
repo search --limit to SearchRepoOpts.Limit.
- Keep backend page size behavior separate from total result limiting.
- Add or update tests to verify the CLI passes
Limit correctly.
Testing
go test ./internal/cli
go test ./...
Summary
Fixes the
repo listandrepo search--limitflag so it caps the total number of returned repositories instead of only changing the API page size.Problem
The CLI currently maps
--limitintoPerPagefor repository list/search options:repo list --limit NsetsListRepoOpts.PerPage = Nrepo search --limit NsetsSearchRepoOpts.PerPage = NThis leaves
Limitunset, so repository listing can keep fetching every page from the API instead of stopping at the requested number of results.Expected behavior
--limit Nshould mean “return at most N repositories”.Changes
repo list --limittoListRepoOpts.Limit.repo search --limittoSearchRepoOpts.Limit.Limitcorrectly.Testing