aboutsummaryrefslogtreecommitdiffstats
path: root/rawshark.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2014-06-21 18:02:27 -0700
committerGuy Harris <guy@alum.mit.edu>2014-06-22 01:06:25 +0000
commitc46329c27b8c31729d2d51dc4f69da9b3923de04 (patch)
tree196522550c36225b4248bc8c6ed2fb86d5b0ddab /rawshark.c
parenta70dea195625f32a026d10d937345d177f81aead (diff)
Add a routine to return a version string including VCS information.
Add a routine get_ws_vcs_version_info() that, for builds from a tree checked out from Wireshark's version control system, returns a string that includes both the Wireshark version number and an indication of what particular VCS version was checked out, and just returns Wireshark's version number for other builds. Use that routine rather than manually gluing VERSION and the Git version number together. ("vcs", not "git", just in case we do something bizarre or mercurial some day. :-)) Change-Id: Ie5c6dc83b9d3f56655eaef30fec3ec9916b6320d Reviewed-on: https://code.wireshark.org/review/2529 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'rawshark.c')
-rw-r--r--rawshark.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/rawshark.c b/rawshark.c
index 48988559e7..5e0e629e15 100644
--- a/rawshark.c
+++ b/rawshark.c
@@ -102,6 +102,8 @@
#include <wiretap/libpcap.h>
#include <wiretap/pcap-encap.h>
+#include <wsutil/ws_version_info.h>
+
#ifdef HAVE_LIBPCAP
#include <setjmp.h>
#include "capture-pcap-util.h"
@@ -189,12 +191,12 @@ print_usage(gboolean print_ver)
if (print_ver) {
output = stdout;
fprintf(output,
- "Rawshark " VERSION "%s\n"
+ "Rawshark %s\n"
"Dump and analyze network traffic.\n"
"See http://www.wireshark.org for more information.\n"
"\n"
"%s",
- wireshark_gitversion, get_copyright_info());
+ get_ws_vcs_version_info(), get_copyright_info());
} else {
output = stderr;
}
@@ -427,14 +429,14 @@ set_link_type(const char *lt_arg) {
static void
show_version(GString *comp_info_str, GString *runtime_info_str)
{
- printf("Rawshark " VERSION "%s\n"
+ printf("Rawshark %s\n"
"\n"
"%s"
"\n"
"%s"
"\n"
"%s",
- wireshark_gitversion, get_copyright_info(), comp_info_str->str,
+ get_ws_vcs_version_info(), get_copyright_info(), comp_info_str->str,
runtime_info_str->str);
}
@@ -480,12 +482,12 @@ main(int argc, char *argv[])
get_runtime_version_info(runtime_info_str, NULL);
/* Add it to the information to be reported on a crash. */
- ws_add_crash_info("Rawshark " VERSION "%s\n"
+ ws_add_crash_info("Rawshark %s\n"
"\n"
"%s"
"\n"
"%s",
- wireshark_gitversion, comp_info_str->str, runtime_info_str->str);
+ get_ws_vcs_version_info(), comp_info_str->str, runtime_info_str->str);
#ifdef _WIN32
arg_list_utf_16to8(argc, argv);