list: reject --page 0 and --limit 0 (1-based; clap range parser, per review)
This commit is contained in:
parent
2005b205e9
commit
f723806eae
1 changed files with 5 additions and 4 deletions
|
|
@ -86,15 +86,16 @@ pub struct Args {
|
||||||
#[arg(long = "label")]
|
#[arg(long = "label")]
|
||||||
labels: Vec<String>,
|
labels: Vec<String>,
|
||||||
/// Page size — items per page (default: 30; forge's per-page cap,
|
/// Page size — items per page (default: 30; forge's per-page cap,
|
||||||
/// ~50, 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`
|
/// Page number to fetch (1-based; default 1). Combine with `--limit`
|
||||||
/// to walk a large result set incrementally — fetch page 1, process,
|
/// to walk a large result set incrementally — fetch page 1, process,
|
||||||
/// fetch page 2, … until a short/empty page. This keeps each call
|
/// fetch page 2, … until a short/empty page. This keeps each call
|
||||||
/// token-bounded (one page at a time) instead of pulling a whole
|
/// token-bounded (one page at a time) instead of pulling a whole
|
||||||
/// repo's population into a single response.
|
/// repo's population into a single response. Must be >= 1 (the forge
|
||||||
#[arg(long, default_value_t = 1)]
|
/// pages are 1-based; page 0 is rejected).
|
||||||
|
#[arg(long, default_value_t = 1, value_parser = clap::value_parser!(u64).range(1..))]
|
||||||
page: u64,
|
page: u64,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue