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);