More fine grained version info.
authorDaniel Carl <danielcarl@gmx.de>
Mon, 19 Jun 2017 21:36:08 +0000 (23:36 +0200)
committerDaniel Carl <danielcarl@gmx.de>
Mon, 19 Jun 2017 21:45:02 +0000 (23:45 +0200)
Show the libraries vimb was compiled against and that are used at
runtime. Remove license info from the output for 'version' or '-v'
option.

.github/ISSUE_TEMPLATE.md [new file with mode: 0644]
config.mk
src/main.c

diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md
new file mode 100644 (file)
index 0000000..433da4c
--- /dev/null
@@ -0,0 +1,7 @@
+<!-- If this is a bug report, please provide your version information
+$ vimb --version -->
+### Steps to reproduce
+
+### Expected behaviour
+
+### Actual behaviour
index 610512e..ecc19fa 100644 (file)
--- a/config.mk
+++ b/config.mk
@@ -20,10 +20,12 @@ DOCDIR  = doc
 # used libs
 LIBS = gtk+-3.0 'webkit2gtk-4.0 >= 2.3.5'
 
+COMMIT := $(shell git describe --tags --always 2> /dev/null || echo "unknown")
+
 # setup general used CFLAGS
 CFLAGS   += -std=c99 -pipe -Wall
 #CPPFLAGS += -pedantic
-CPPFLAGS += -DVERSION=\"${VERSION}\" -DEXTENSIONDIR=\"${EXTENSIONDIR}\"
+CPPFLAGS += -DVERSION=\"${VERSION}\" -DEXTENSIONDIR=\"${EXTENSIONDIR}\" -DCOMMIT=\"$(COMMIT)\"
 CPPFLAGS += -DPROJECT=\"vimb\" -DPROJECT_UCFIRST=\"Vimb\"
 CPPFLAGS += -D_XOPEN_SOURCE=500
 CPPFLAGS += -D__BSD_VISIBLE
index c3fb8de..fe7d22f 100644 (file)
@@ -1758,7 +1758,7 @@ int main(int argc, char* argv[])
     gboolean ver = FALSE;
 
     GOptionEntry opts[] = {
-        {"embed", 'e', 0, G_OPTION_ARG_STRING, &winid,  "Reparents to window specified by xid", NULL},
+        {"embed", 'e', 0, G_OPTION_ARG_STRING, &winid, "Reparents to window specified by xid", NULL},
         {"config", 'c', 0, G_OPTION_ARG_FILENAME, &vb.configfile, "Custom configuration file", NULL},
         {"profile", 'p', 0, G_OPTION_ARG_CALLBACK, (GOptionArgFunc*)profileOptionArgFunc, "Profile name", NULL},
         {"version", 'v', 0, G_OPTION_ARG_NONE, &ver, "Print version", NULL},
@@ -1774,11 +1774,32 @@ int main(int argc, char* argv[])
     }
 
     if (ver) {
-        fprintf(stdout, "%s, version %s\n\n", PROJECT, VERSION);
-        fprintf(stdout, "Copyright © 2012 - 2017 Daniel Carl <danielcarl@gmx.de>\n");
-        fprintf(stdout, "License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\n");
-        fprintf(stdout, "This is free software; you are free to change and redistribute it.\n");
-        fprintf(stdout, "There is NO WARRANTY, to the extent permitted by law.\n");
+        printf("%s, version %s\n\n", PROJECT, VERSION);
+        printf("Commit:          %s\n", COMMIT);
+        printf("WebKit compile:  %d.%d.%d\n",
+                WEBKIT_MAJOR_VERSION,
+                WEBKIT_MINOR_VERSION, 
+                WEBKIT_MICRO_VERSION);
+        printf("WebKit run:      %d.%d.%d\n",
+                webkit_get_major_version(),
+                webkit_get_minor_version(),
+                webkit_get_micro_version());
+        printf("GTK compile:     %d.%d.%d\n",
+                GTK_MAJOR_VERSION,
+                GTK_MINOR_VERSION,
+                GTK_MICRO_VERSION);
+        printf("GTK run:         %d.%d.%d\n",
+                gtk_major_version,
+                gtk_minor_version,
+                gtk_micro_version);
+        printf("libsoup compile: %d.%d.%d\n",
+                SOUP_MAJOR_VERSION,
+                SOUP_MINOR_VERSION,
+                SOUP_MICRO_VERSION);
+        printf("libsoup run:     %u.%u.%u\n",
+                soup_get_major_version(),
+                soup_get_minor_version(),
+                soup_get_micro_version());
 
         return EXIT_SUCCESS;
     }