From c58d8ca339eddea8bb6b993b301fa82ebd0d824f Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Fri, 3 Oct 2025 09:46:03 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(list):=20add=20pagination=20to?= =?UTF-8?q?=20list=20command?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - add pages option to limit the number of pages to retrieve - set default pages to 1 - modify list.run to accept the pages parameter --- src/list_cli.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/list_cli.rs b/src/list_cli.rs index ad03639..d46dca1 100644 --- a/src/list_cli.rs +++ b/src/list_cli.rs @@ -4,8 +4,12 @@ use cull_gmail::{Error, List}; /// Command line options for the list subcommand #[derive(Debug, Parser)] pub struct ListCli { + /// Maximum results per page #[arg(short, long, default_value = cull_gmail::DEFAULT_MAX_RESULTS)] max_results: u32, + /// Maximum number of pages (0=all) + #[arg(short, long, default_value = "1")] + pages: u32, } impl ListCli { @@ -16,6 +20,6 @@ impl ListCli { list.set_max_results(self.max_results); log::debug!("List max results set to {}", list.max_results()); - list.run().await + list.run(self.pages).await } }