diff options
author | Bryan Newbold <bnewbold@archive.org> | 2021-02-14 19:34:09 -0800 |
---|---|---|
committer | Bryan Newbold <bnewbold@archive.org> | 2021-02-14 19:34:09 -0800 |
commit | fedc0eaad141ed251a5cfbb3f704068e246c9f70 (patch) | |
tree | 140abcfd3a637e73beff1fdb115824b4aa3055a8 | |
parent | 658401529378bf7bdc6747ae1745d76732fd51f9 (diff) | |
download | fatcat-cli-fedc0eaad141ed251a5cfbb3f704068e246c9f70.tar.gz fatcat-cli-fedc0eaad141ed251a5cfbb3f704068e246c9f70.zip |
include API version built against in 'status' output
-rw-r--r-- | fatcat-cli/src/commands.rs | 7 |
1 files changed, 7 insertions, 0 deletions
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<i64>, pub account: Option<models::Editor>, + 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(), }) } @@ -98,6 +100,11 @@ impl ClientStatus { 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)?; write!(&mut color_stdout, "{}", self.api_host)?; |