Make binaries say what git commit they come from

The manual skipping of the initial "v" from tag names is unfortunate,
but still a bit better than further cluttering up the build system.
This commit is contained in:
2022-08-12 21:16:37 +02:00
parent dcbc8a90b4
commit dd09af34b7
3 changed files with 16 additions and 9 deletions

View File

@@ -397,7 +397,8 @@ main(int argc, char *argv[])
gboolean initialized = gtk_init_with_args(
&argc, &argv, " - Lossless JPEG cropper", options, NULL, &error);
if (show_version) {
printf("fiv-jpegcrop " PROJECT_VERSION "\n");
const char *version = PROJECT_VERSION;
printf("%s %s\n", "fiv-jpegcrop", &version[*version == 'v']);
return 0;
}
if (!initialized)