Explorar el Código

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

ariasuni hace 5 años
padre
commit
42bc34f339
Se han modificado 1 ficheros con 5 adiciones y 1 borrados
  1. 5 1
      src/options/version.rs

+ 5 - 1
src/options/version.rs

@@ -31,7 +31,11 @@ impl VersionString {
 
 impl fmt::Display for VersionString {
     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" })
     }
 }