Skip to content

Fix repo limit flag to cap total results #133

Description

@abhinavgautam01

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 ./...

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions