瀏覽代碼

Tell if exa was compiled with git support or not when using --help

ariasuni 5 年之前
父節點
當前提交
42bc34f339
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5 1
      src/options/version.rs

+ 5 - 1
src/options/version.rs

@@ -31,7 +31,11 @@ impl VersionString {
 
 
 impl fmt::Display for VersionString {
 impl fmt::Display for VersionString {
     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> {
     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> {
-        writeln!(f, "{}", include!(concat!(env!("OUT_DIR"), "/version_string.txt")))
+        writeln!(
+            f,
+            "{} (git support: {})",
+            include!(concat!(env!("OUT_DIR"), "/version_string.txt")),
+            if cfg!(feature = "git") { "enabled" } else { "disabled" })
     }
     }
 }
 }