From ea046c929f6757412b2e03a176e9d73d1d0f27fc Mon Sep 17 00:00:00 2001 From: Robert Garrett Date: Wed, 2 Jul 2025 21:42:41 -0500 Subject: [PATCH] Print releases in reverse order for easier reading The result list has the newest item first, but I want to print them the other way around. This way the newest (and presumably most interesting) release is always the visible item, regardless of how many others have printed and scrolled off screen. --- src/main.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 67c6241..5685d5f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -33,7 +33,10 @@ async fn main() -> Result<(), gt_tool::Error> { gt_tool::cli::Commands::ListReleases => { let releases = gt_tool::api::release::list_releases(&client, &args.gitea_url, &args.repo).await?; - for release in releases { + // Print in reverse order so the newest items are closest to the + // user's command prompt. Otherwise the newest item scrolls off the + // screen and can't be seen. + for release in releases.iter().rev() { println!("{}", release); } }