Move verbose banner output to show_version() and tighten scope of some variables
svn path=/trunk/; revision=30017
This commit is contained in:
parent
17b6592540
commit
a7081629f0
50
tshark.c
50
tshark.c
|
@ -108,9 +108,8 @@ static const gchar decode_as_arg_template[] = "<layer_type>==<selector>,<decode_
|
||||||
static nstime_t first_ts;
|
static nstime_t first_ts;
|
||||||
static nstime_t prev_dis_ts;
|
static nstime_t prev_dis_ts;
|
||||||
static nstime_t prev_cap_ts;
|
static nstime_t prev_cap_ts;
|
||||||
static GString *comp_info_str, *runtime_info_str;
|
|
||||||
|
|
||||||
static gboolean print_packet_info; /* TRUE if we're to print packet information */
|
static gboolean print_packet_info; /* TRUE if we're to print packet information */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The way the packet decode is to be written.
|
* The way the packet decode is to be written.
|
||||||
*/
|
*/
|
||||||
|
@ -733,7 +732,19 @@ check_capture_privs(void) {
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
show_version(GString *comp_info_str, GString *runtime_info_str)
|
||||||
|
{
|
||||||
|
printf("TShark " VERSION "%s\n"
|
||||||
|
"\n"
|
||||||
|
"%s"
|
||||||
|
"\n"
|
||||||
|
"%s"
|
||||||
|
"\n"
|
||||||
|
"%s",
|
||||||
|
wireshark_svnversion, get_copyright_info(), comp_info_str->str,
|
||||||
|
runtime_info_str->str);
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char *argv[])
|
main(int argc, char *argv[])
|
||||||
|
@ -992,14 +1003,6 @@ main(int argc, char *argv[])
|
||||||
|
|
||||||
init_cap_file(&cfile);
|
init_cap_file(&cfile);
|
||||||
|
|
||||||
/* Assemble the compile-time version information string */
|
|
||||||
comp_info_str = g_string_new("Compiled ");
|
|
||||||
get_compiled_version_info(comp_info_str, get_epan_compiled_version_info);
|
|
||||||
|
|
||||||
/* Assemble the run-time version information string */
|
|
||||||
runtime_info_str = g_string_new("Running ");
|
|
||||||
get_runtime_version_info(runtime_info_str, NULL);
|
|
||||||
|
|
||||||
/* Print format defaults to this. */
|
/* Print format defaults to this. */
|
||||||
print_format = PR_FMT_TEXT;
|
print_format = PR_FMT_TEXT;
|
||||||
|
|
||||||
|
@ -1185,18 +1188,23 @@ main(int argc, char *argv[])
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'v': /* Show version and exit */
|
case 'v': /* Show version and exit */
|
||||||
printf("TShark " VERSION "%s\n"
|
{
|
||||||
"\n"
|
GString *comp_info_str;
|
||||||
"%s"
|
GString *runtime_info_str;
|
||||||
"\n"
|
/* Assemble the compile-time version information string */
|
||||||
"%s"
|
comp_info_str = g_string_new("Compiled ");
|
||||||
"\n"
|
get_compiled_version_info(comp_info_str, get_epan_compiled_version_info);
|
||||||
"%s",
|
|
||||||
wireshark_svnversion, get_copyright_info(), comp_info_str->str,
|
/* Assemble the run-time version information string */
|
||||||
runtime_info_str->str);
|
runtime_info_str = g_string_new("Running ");
|
||||||
|
get_runtime_version_info(runtime_info_str, NULL);
|
||||||
|
show_version(comp_info_str, runtime_info_str);
|
||||||
|
g_string_free(comp_info_str, TRUE);
|
||||||
|
g_string_free(runtime_info_str, TRUE);
|
||||||
exit(0);
|
exit(0);
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case 'V': /* Verbose */
|
case 'V': /* Verbose */
|
||||||
verbose = TRUE;
|
verbose = TRUE;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue