Compare commits
2 changed files with 7 additions and 20 deletions
|
|
@ -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 # unified diff (lockfile hunks collapsed by default)
|
||||||
hive-forge diff 42 --full # include unfiltered lockfile hunks
|
hive-forge diff 42 --full # include unfiltered lockfile hunks
|
||||||
hive-forge list # open issues/PRs
|
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 milestone # list milestones
|
||||||
hive-forge branches deployed/ # filter branches by pattern
|
hive-forge branches deployed/ # filter branches by pattern
|
||||||
hive-forge tree-sha main # git tree SHA for a ref
|
hive-forge tree-sha main # git tree SHA for a ref
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,7 @@
|
||||||
//! `list [--kind issue|pr|both] [--state open|closed|all] [--assignee
|
//! `list [--kind issue|pr|both] [--state open|closed|all] [--assignee
|
||||||
//! <user>] [--author <user>] [--label <name>] [--limit N] [--page N]` —
|
//! <user>] [--author <user>] [--label <name>] [--limit N]` — list
|
||||||
//! list issues / PRs with filters. Pretty `#NNN [author] title` output by
|
//! issues / PRs with filters. Pretty `#NNN [author] title` output by
|
||||||
//! default; `--json` for piping. `--limit` is the page size and `--page`
|
//! default; `--json` for piping.
|
||||||
//! the 1-based page number — walk pages incrementally for a large result
|
|
||||||
//! set rather than pulling the whole population into one response.
|
|
||||||
//!
|
//!
|
||||||
//! Mirrors Forgejo's `GET /repos/{owner}/{repo}/issues` query-string
|
//! Mirrors Forgejo's `GET /repos/{owner}/{repo}/issues` query-string
|
||||||
//! filters one-for-one so the mental model carries over. Closes the
|
//! 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.
|
/// Filter to items carrying any of these label names. Repeatable.
|
||||||
#[arg(long = "label")]
|
#[arg(long = "label")]
|
||||||
labels: Vec<String>,
|
labels: Vec<String>,
|
||||||
/// Page size — items per page (default: 30; forge's per-page cap,
|
/// Max items to return (default: 30; forge's per-page cap applies).
|
||||||
/// ~50, applies). Must be >= 1.
|
#[arg(long, default_value_t = 30)]
|
||||||
#[arg(long, default_value_t = 30, value_parser = clap::value_parser!(u64).range(1..))]
|
|
||||||
limit: u64,
|
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<()> {
|
pub fn run(client: &Client, args: Args) -> Result<()> {
|
||||||
let repo = client.repo();
|
let repo = client.repo();
|
||||||
let mut path = format!(
|
let mut path = format!(
|
||||||
"/repos/{repo}/issues?type={}&state={}&limit={}&page={}",
|
"/repos/{repo}/issues?type={}&state={}&limit={}",
|
||||||
args.kind.api_value(),
|
args.kind.api_value(),
|
||||||
args.state.api_value(),
|
args.state.api_value(),
|
||||||
args.limit,
|
args.limit
|
||||||
args.page
|
|
||||||
);
|
);
|
||||||
if let Some(u) = args.assignee.as_deref()
|
if let Some(u) = args.assignee.as_deref()
|
||||||
&& !u.is_empty()
|
&& !u.is_empty()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue