Skip to content

Commit 219cf72

Browse files
committed
Fix --max-pages pagination not activating without --all-pages
--max-pages implies pagination; only skip the loop when both all_pages is false AND max_pages is None.
1 parent 4cfd5d7 commit 219cf72

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/commands/search.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pub async fn run(
1717
let mut params_map = params::params_to_hashmap(params);
1818
params::apply_fields(&mut params_map, fields);
1919

20-
if !all_pages {
20+
if !all_pages && max_pages.is_none() {
2121
let client = make_client(api_key)?;
2222
let result = tokio::time::timeout(
2323
Duration::from_secs(30),

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ enum Command {
4242
/// Fetch all pages and merge array results
4343
#[arg(long)]
4444
all_pages: bool,
45-
/// Maximum number of pages to fetch when --all-pages is set (default: unlimited)
45+
/// Maximum number of pages to fetch; implies pagination (default: unlimited with --all-pages)
4646
#[arg(long)]
4747
max_pages: Option<usize>,
4848
},

0 commit comments

Comments
 (0)