]> git.refcnt.org Git - colorize.git/blobdiff - colorize.c
Include commit hash in version output
[colorize.git] / colorize.c
index 54f6889fe3c308a74550bc38b335b3d0853a408a..ea18425296267f085d84d605fcb0d8080c3c39d1 100644 (file)
@@ -403,6 +403,11 @@ print_help (void)
 static void
 print_version (void)
 {
+#ifdef HAVE_VERSION
+# include "version.h"
+#else
+    const char *version = NULL;
+#endif
     const char *c_flags;
     struct bytes_size bytes_size;
     bool debug;
@@ -416,7 +421,10 @@ print_version (void)
 #else
     debug = false;
 #endif
-    printf ("%s v%s (compiled at %s, %s)\n", "colorize", VERSION, __DATE__, __TIME__);
+    if (version)
+      printf ("colorize %s (compiled at %s, %s)\n", version, __DATE__, __TIME__);
+    else
+      printf ("colorize v%s (compiled at %s, %s)\n", VERSION, __DATE__, __TIME__);
     printf ("Compiler flags: %s\n", c_flags);
     if (get_bytes_size (BUF_SIZE, &bytes_size))
       {