return status;
}
+static void
+print_version(FILE *output)
+{
+ fprintf(output, "Capinfos %s"
+#ifdef GITVERSION
+ " (" GITVERSION " from " GITBRANCH ")"
+#endif
+ "\n", VERSION);
+}
+
static void
usage(gboolean is_error)
{
output = stderr;
}
- fprintf(output, "Capinfos %s"
-#ifdef GITVERSION
- " (" GITVERSION " from " GITBRANCH ")"
-#endif
- "\n", VERSION);
+ print_version(output);
fprintf(output, "Prints various information (infos) about capture files.\n");
fprintf(output, "See http://www.wireshark.org for more information.\n");
fprintf(output, "\n");
exit(0);
break;
+ case 'v':
+ print_version(stdout);
+ exit(0);
+ break;
+
case '?': /* Bad flag - print usage message */
usage(TRUE);
exit(1);