diff options
author | Gerald Combs <gerald@wireshark.org> | 2016-06-30 14:55:19 -0700 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2016-07-01 02:10:22 +0000 |
commit | 5cf7fcdf0f62cf0d8617428141a26e6f280a45d0 (patch) | |
tree | 104b76a624fe278c5db96591e97d26912f64f5ea /ui/commandline.c | |
parent | f860e8de525d721d6678896fc9ef415ea68e2ead (diff) | |
download | wireshark-5cf7fcdf0f62cf0d8617428141a26e6f280a45d0.tar.gz |
Qt+Gtk: Fix the -t command line flag.
Add the time format to commandline_param_info_t and apply it when we've
finished application initialization.
Bug: 12489
Change-Id: Ice626198a610567e945a8e53c0c1093797e8208e
Reviewed-on: https://code.wireshark.org/review/16232
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'ui/commandline.c')
-rw-r--r-- | ui/commandline.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/ui/commandline.c b/ui/commandline.c index c3bb8ddac3..e936a327b9 100644 --- a/ui/commandline.c +++ b/ui/commandline.c @@ -387,6 +387,7 @@ void commandline_other_options(int argc, char *argv[], gboolean opt_reset) global_commandline_info.cf_name = NULL; global_commandline_info.rfilter = NULL; global_commandline_info.dfilter = NULL; + global_commandline_info.time_format = TS_NOT_SET; #ifdef HAVE_LIBPCAP global_commandline_info.start_capture = FALSE; global_commandline_info.list_link_layer_types = FALSE; @@ -537,25 +538,25 @@ void commandline_other_options(int argc, char *argv[], gboolean opt_reset) break; case 't': /* Time stamp type */ if (strcmp(optarg, "r") == 0) - timestamp_set_type(TS_RELATIVE); + global_commandline_info.time_format = TS_RELATIVE; else if (strcmp(optarg, "a") == 0) - timestamp_set_type(TS_ABSOLUTE); + global_commandline_info.time_format = TS_ABSOLUTE; else if (strcmp(optarg, "ad") == 0) - timestamp_set_type(TS_ABSOLUTE_WITH_YMD); + global_commandline_info.time_format = TS_ABSOLUTE_WITH_YMD; else if (strcmp(optarg, "adoy") == 0) - timestamp_set_type(TS_ABSOLUTE_WITH_YDOY); + global_commandline_info.time_format = TS_ABSOLUTE_WITH_YDOY; else if (strcmp(optarg, "d") == 0) - timestamp_set_type(TS_DELTA); + global_commandline_info.time_format = TS_DELTA; else if (strcmp(optarg, "dd") == 0) - timestamp_set_type(TS_DELTA_DIS); + global_commandline_info.time_format = TS_DELTA_DIS; else if (strcmp(optarg, "e") == 0) - timestamp_set_type(TS_EPOCH); + global_commandline_info.time_format = TS_EPOCH; else if (strcmp(optarg, "u") == 0) - timestamp_set_type(TS_UTC); + global_commandline_info.time_format = TS_UTC; else if (strcmp(optarg, "ud") == 0) - timestamp_set_type(TS_UTC_WITH_YMD); + global_commandline_info.time_format = TS_UTC_WITH_YMD; else if (strcmp(optarg, "udoy") == 0) - timestamp_set_type(TS_UTC_WITH_YDOY); + global_commandline_info.time_format = TS_UTC_WITH_YDOY; else { cmdarg_err("Invalid time stamp type \"%s\"", optarg); cmdarg_err_cont("It must be \"a\" for absolute, \"ad\" for absolute with YYYY-MM-DD date,"); |