diff --git a/gtk/main.c b/gtk/main.c index 09a6af2949..514dbd354e 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -1198,6 +1198,7 @@ print_usage(gboolean print_ver) { fprintf(output, " -j search backwards for a matching packet after \"-J\"\n"); fprintf(output, " -m set the font name used for most text\n"); fprintf(output, " -t ad|a|r|d|dd|e output format of time stamps (def: r: rel. to first)\n"); + fprintf(output, " -u s|hms output format of seconds (def: s: seconds)\n"); fprintf(output, " -X : eXtension options, see man page for details\n"); fprintf(output, " -z show various statistics, see man page for details\n"); @@ -2018,7 +2019,7 @@ main(int argc, char *argv[]) #endif #endif -#define OPTSTRING_INIT "a:b:c:C:Df:g:Hhi:jJ:kK:lLm:nN:o:P:pQr:R:Ss:t:T:vw:X:y:z:" +#define OPTSTRING_INIT "a:b:c:C:Df:g:Hhi:jJ:kK:lLm:nN:o:P:pQr:R:Ss:t:u:vw:X:y:z:" #if defined HAVE_LIBPCAP && defined _WIN32 #define OPTSTRING_WIN32 "B:" @@ -2542,7 +2543,7 @@ main(int argc, char *argv[]) exit(1); } break; - case 'T': /* Seconds type */ + case 'u': /* Seconds type */ if (strcmp(optarg, "s") == 0) timestamp_set_seconds_type(TS_SECONDS_DEFAULT); else if (strcmp(optarg, "hms") == 0) diff --git a/tshark.c b/tshark.c index e7837ac091..2350cca994 100644 --- a/tshark.c +++ b/tshark.c @@ -283,6 +283,7 @@ print_usage(gboolean print_ver) fprintf(output, " separator=/t|/s| select tab, space, printable character as separator\n"); fprintf(output, " quote=d|s|n select double, single, no quotes for values\n"); fprintf(output, " -t ad|a|r|d|dd|e output format of time stamps (def: r: rel. to first)\n"); + fprintf(output, " -u s|hms output format of seconds (def: s: seconds)\n"); fprintf(output, " -l flush standard output after each packet\n"); fprintf(output, " -q be more quiet on stdout (e.g. when using statistics)\n"); fprintf(output, " -X : eXtension options, see the man page for details\n"); @@ -766,7 +767,7 @@ main(int argc, char *argv[]) GLogLevelFlags log_flags; int optind_initial; -#define OPTSTRING_INIT "a:b:c:C:d:De:E:f:F:G:hi:K:lLnN:o:pPqr:R:s:St:T:vVw:xX:y:z:" +#define OPTSTRING_INIT "a:b:c:C:d:De:E:f:F:G:hi:K:lLnN:o:pPqr:R:s:St:T:u:vVw:xX:y:z:" #ifdef HAVE_LIBPCAP #ifdef _WIN32 #define OPTSTRING_WIN32 "B:" @@ -1175,6 +1176,17 @@ main(int argc, char *argv[]) exit(1); } break; + case 'u': /* Seconds type */ + if (strcmp(optarg, "s") == 0) + timestamp_set_seconds_type(TS_SECONDS_DEFAULT); + else if (strcmp(optarg, "hms") == 0) + timestamp_set_seconds_type(TS_SECONDS_HOUR_MIN_SEC); + else { + cmdarg_err("Invalid seconds type \"%s\"", optarg); + cmdarg_err_cont("It must be \"s\" for seconds or \"hms\" for hours, minutes and seconds."); + exit(1); + } + break; case 'v': /* Show version and exit */ { GString *comp_info_str;