소스 검색

feat(options): use version string from file for --version flag

Replaces `clap::crate_version!()` with `include_str!(concat!(env!
("OUT_DIR"), "/version_string.txt"))` for the `--version` flag. This
ensures that the version string, which includes build metadata like Git
hash and build date, is properly displayed when `eza --version` is run,
maintaining feature parity with previous behavior.
Christina Sørensen 2 달 전
부모
커밋
b2eb0d8daf
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/options/parser.rs

+ 1 - 1
src/options/parser.rs

@@ -28,7 +28,7 @@ pub fn get_command() -> clap::Command {
     clap::Command::new(clap::crate_name!())
         .author(clap::crate_authors!())
         .about(clap::crate_description!())
-        .version(clap::crate_version!())
+        .version(include_str!(concat!(env!("OUT_DIR"), "/version_string.txt")))
         .disable_help_flag(true)
         .disable_version_flag(true)
         .args_override_self(true)