From fedc0eaad141ed251a5cfbb3f704068e246c9f70 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Sun, 14 Feb 2021 19:34:09 -0800 Subject: include API version built against in 'status' output --- fatcat-cli/src/commands.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/fatcat-cli/src/commands.rs b/fatcat-cli/src/commands.rs index 32bfea2..624374a 100644 --- a/fatcat-cli/src/commands.rs +++ b/fatcat-cli/src/commands.rs @@ -27,6 +27,7 @@ pub struct ClientStatus { pub api_host: String, pub last_changelog: Option, pub account: Option, + pub cli_api_version: String, } impl ClientStatus { @@ -80,6 +81,7 @@ impl ClientStatus { has_api_token, last_changelog, account, + cli_api_version: fatcat_openapi::API_VERSION.to_string(), }) } @@ -97,6 +99,11 @@ impl ClientStatus { let mut color_sad = ColorSpec::new(); color_sad.set_fg(Some(Color::Red)).set_bold(true); + color_stdout.set_color(&color_normal)?; + write!(&mut color_stdout, "{:>16}: ", "API Version")?; + color_stdout.set_color(&color_bold)?; + writeln!(&mut color_stdout, "{} (local)", self.cli_api_version)?; + color_stdout.set_color(&color_normal)?; write!(&mut color_stdout, "{:>16}: ", "API host")?; color_stdout.set_color(&color_bold)?; -- cgit v1.2.3