From d1b576e7ec889bdd8bf6f4dc3d27d98745ffc0c1 Mon Sep 17 00:00:00 2001 From: Daniel Carl Date: Mon, 19 Jun 2017 23:36:08 +0200 Subject: [PATCH] More fine grained version info. 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 | 7 +++++++ config.mk | 4 +++- src/main.c | 33 +++++++++++++++++++++++++++------ 3 files changed, 37 insertions(+), 7 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE.md diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 0000000..433da4c --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,7 @@ + +### Steps to reproduce + +### Expected behaviour + +### Actual behaviour diff --git a/config.mk b/config.mk index 610512e..ecc19fa 100644 --- 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 diff --git a/src/main.c b/src/main.c index c3fb8de..fe7d22f 100644 --- a/src/main.c +++ b/src/main.c @@ -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 \n"); - fprintf(stdout, "License GPLv3+: GNU GPL version 3 or later \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; } -- 2.20.1