Show --bug-info separate from version.
authorDaniel Carl <danielcarl@gmx.de>
Mon, 24 Jul 2017 21:23:02 +0000 (23:23 +0200)
committerDaniel Carl <danielcarl@gmx.de>
Mon, 24 Jul 2017 21:23:02 +0000 (23:23 +0200)
Do not print to much in case the user is only interested in the current
used version. So show vimb version only on options -v, --version and
added the new option --bug-version which shows the currently used libs
and the library versions vimb was compiled against.

.github/ISSUE_TEMPLATE.md
CHANGELOG.md
doc/vimb.1
src/main.c

index 433da4c..91bdb03 100644 (file)
@@ -1,5 +1,5 @@
 <!-- If this is a bug report, please provide your version information
-$ vimb --version -->
+$ vimb --bug-info -->
 ### Steps to reproduce
 
 ### Expected behaviour
index 624501f..7ccdceb 100644 (file)
@@ -22,8 +22,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
   the first char.
   * `hint-keys=0123` -> `1 2 3 10 11 12 13`
   * `hint-keys=asdf` -> `a s d f aa as ad af`
-* Show versions of used libs on `vimb -v` and the extension directory for
-  easier issue investigation.
+* Show versions of used libs on `vimb --bug-info` and the extension directory
+  for easier issue investigation.
 * During hinting JavaScript is enabled and reset to it's previous setting after
   hinting is done might be security relevant.
 * Allow extended hints mode also for open `g;o` to allow the user to toggle
index a26b0c4..d1078f9 100644 (file)
@@ -46,7 +46,10 @@ Configuration data for the profile is stored in a directory named
 \fIPROFILE-NAME\fP under default directory for configuration data.
 .TP
 .B "\-v, \-\-version"
-Print build and version information.
+Print build and version information and then quit.
+.TP
+.B "\-\-bug-info"
+Prints information about used libraries for bug reports and then quit.
 .SH MODES
 Vimb is modal and has the following main modes:
 .TP
index c00e80a..131c149 100644 (file)
@@ -1764,13 +1764,14 @@ int main(int argc, char* argv[])
     Client *c;
     GError *err = NULL;
     char *pidstr, *winid = NULL;
-    gboolean ver = FALSE;
+    gboolean ver = FALSE, buginfo = FALSE;
 
     GOptionEntry opts[] = {
         {"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},
+        {"bug-info", 0, 0, G_OPTION_ARG_NONE, &buginfo, "Print used library versions", NULL},
         {NULL}
     };
 
@@ -1784,6 +1785,10 @@ int main(int argc, char* argv[])
 
     if (ver) {
         printf("%s, version %s\n\n", PROJECT, VERSION);
+        return EXIT_SUCCESS;
+    }
+
+    if (buginfo) {
         printf("Commit:          %s\n", COMMIT);
         printf("WebKit compile:  %d.%d.%d\n",
                 WEBKIT_MAJOR_VERSION,