From e928ce51bd8c26742abfd537b054483a18a9689c Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Fri, 30 Jun 2023 02:37:27 +0200 Subject: show git hash with --version Also, use cmake's configure_file to build string constants in. --- src/cmd_line.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/cmd_line.c') diff --git a/src/cmd_line.c b/src/cmd_line.c index 7f437d1..cd1a50a 100644 --- a/src/cmd_line.c +++ b/src/cmd_line.c @@ -6,6 +6,7 @@ */ #include "cmd_line.h" +#include "const.h" #include "file.h" #include "log.h" @@ -62,7 +63,7 @@ void exit_with_version(void) { char *binary = get_current_binary_name(); - printf("%s %s\n", binary ? binary : "prog", VERSION); + printf("%s v%s (%s)\n", binary ? binary : "prog", project_version, project_rev); free(binary); exit(0); } -- cgit v1.2.3