diff --git a/docs/tools/forge.md b/docs/tools/forge.md index 53b5cb51..18444951 100644 --- a/docs/tools/forge.md +++ b/docs/tools/forge.md @@ -37,7 +37,6 @@ hive-forge pr-reviews 42 --comment -m "msg" # submit COMMENT review hive-forge diff 42 # unified diff (lockfile hunks collapsed by default) hive-forge diff 42 --full # include unfiltered lockfile hunks hive-forge list # open issues/PRs -hive-forge list --kind pr --state all --page 2 # page 2 of all PRs (walk --page 1,2,… with --limit as page size for a repo-wide sweep) hive-forge milestone # list milestones hive-forge branches deployed/ # filter branches by pattern hive-forge tree-sha main # git tree SHA for a ref diff --git a/hive-forge/src/verbs/list.rs b/hive-forge/src/verbs/list.rs index 81db0f0e..00c82870 100644 --- a/hive-forge/src/verbs/list.rs +++ b/hive-forge/src/verbs/list.rs @@ -1,9 +1,7 @@ //! `list [--kind issue|pr|both] [--state open|closed|all] [--assignee -//! ] [--author ] [--label ] [--limit N] [--page N]` — -//! list issues / PRs with filters. Pretty `#NNN [author] title` output by -//! default; `--json` for piping. `--limit` is the page size and `--page` -//! the 1-based page number — walk pages incrementally for a large result -//! set rather than pulling the whole population into one response. +//! ] [--author ] [--label ] [--limit N]` — list +//! issues / PRs with filters. Pretty `#NNN [author] title` output by +//! default; `--json` for piping. //! //! Mirrors Forgejo's `GET /repos/{owner}/{repo}/issues` query-string //! filters one-for-one so the mental model carries over. Closes the @@ -85,28 +83,18 @@ pub struct Args { /// Filter to items carrying any of these label names. Repeatable. #[arg(long = "label")] labels: Vec, - /// Page size — items per page (default: 30; forge's per-page cap, - /// ~50, applies). Must be >= 1. - #[arg(long, default_value_t = 30, value_parser = clap::value_parser!(u64).range(1..))] + /// Max items to return (default: 30; forge's per-page cap applies). + #[arg(long, default_value_t = 30)] limit: u64, - /// Page number to fetch (1-based; default 1). Combine with `--limit` - /// to walk a large result set incrementally — fetch page 1, process, - /// fetch page 2, … until a short/empty page. This keeps each call - /// token-bounded (one page at a time) instead of pulling a whole - /// repo's population into a single response. Must be >= 1 (the forge - /// pages are 1-based; page 0 is rejected). - #[arg(long, default_value_t = 1, value_parser = clap::value_parser!(u64).range(1..))] - page: u64, } pub fn run(client: &Client, args: Args) -> Result<()> { let repo = client.repo(); let mut path = format!( - "/repos/{repo}/issues?type={}&state={}&limit={}&page={}", + "/repos/{repo}/issues?type={}&state={}&limit={}", args.kind.api_value(), args.state.api_value(), - args.limit, - args.page + args.limit ); if let Some(u) = args.assignee.as_deref() && !u.is_empty()