summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/version.rs27
1 files changed, 14 insertions, 13 deletions
diff --git a/src/version.rs b/src/version.rs
index b075a8f873..e96adf5280 100644
--- a/src/version.rs
+++ b/src/version.rs
@@ -15,24 +15,25 @@ pub(crate) struct VersionInfo {
impl fmt::Display for VersionInfo {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
- write!(f, "{}", self.version)?;
+ write!(f, "{}\n\n", self.version)?;
- match (&self.commit_info, self.rustc_version) {
- (Some(commit_info), Some(rustc_version)) => write!(
+ if let Some(commit_info) = &self.commit_info {
+ writeln!(
f,
- " ({} {}, built with rustc {})",
- commit_info.short_commit_hash, commit_info.commit_date, rustc_version
- )?,
- (Some(commit_info), None) => write!(
- f,
- " ({} {})",
+ "Revision: {} {}",
commit_info.short_commit_hash, commit_info.commit_date
- )?,
- (None, Some(rustc_version)) => write!(f, " (built with rustc {})", rustc_version)?,
- (None, None) => {}
+ )?;
+ }
+ if let Some(rustc_version) = self.rustc_version {
+ writeln!(f, "Toolchain: {}", rustc_version)?;
}
- Ok(())
+ writeln!(
+ f,
+ "System: {} {}",
+ std::env::consts::OS,
+ std::env::consts::ARCH
+ )
}
}