From aa504c2c0e78f8a997ba1791a911be26a0c1f688 Mon Sep 17 00:00:00 2001 From: chaodu-agent Date: Sun, 28 Jun 2026 09:19:05 -0400 Subject: [PATCH] fix: ghp version prints own version before gh version --- Cargo.toml | 2 +- ghp/Cargo.toml | 2 +- ghp/src/main.rs | 8 ++++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 82377fe..a2067c7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ghpool" -version = "0.3.1" +version = "0.3.2" edition = "2021" description = "Internal GitHub API proxy with PAT pooling and caching" license = "MIT" diff --git a/ghp/Cargo.toml b/ghp/Cargo.toml index e4d8928..0d4a2e4 100644 --- a/ghp/Cargo.toml +++ b/ghp/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ghp" -version = "0.1.0" +version = "0.1.1" edition = "2021" description = "gh CLI shim that routes read commands through ghpool" diff --git a/ghp/src/main.rs b/ghp/src/main.rs index 906d8a7..c669f9a 100644 --- a/ghp/src/main.rs +++ b/ghp/src/main.rs @@ -6,6 +6,14 @@ fn main() { let ghpool_url = env::var("GHPOOL_URL") .unwrap_or_else(|_| "http://ghpool.openab.local:8080".to_string()); + // Handle version + if args.first().map(|s| s.as_str()) == Some("version") || args.first().map(|s| s.as_str()) == Some("--version") { + println!("ghp version {}", env!("CARGO_PKG_VERSION")); + let gh = find_real_gh(); + let _ = Command::new(&gh).arg("--version").status(); + exit(0); + } + // Try to handle as a pooled read via ghpool REST if let Some(code) = try_pooled(&args, &ghpool_url) { exit(code);