Moved command line option for seconds type to -u.

Added this option to tshark.

svn path=/trunk/; revision=32685
This commit is contained in:
Stig Bjørlykke 2010-05-06 12:31:24 +00:00
parent 39eb93b5a2
commit 54101a8630
2 changed files with 16 additions and 3 deletions

View File

@ -1198,6 +1198,7 @@ print_usage(gboolean print_ver) {
fprintf(output, " -j search backwards for a matching packet after \"-J\"\n");
fprintf(output, " -m <font> 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 <key>:<value> eXtension options, see man page for details\n");
fprintf(output, " -z <statistics> 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)

View File

@ -283,6 +283,7 @@ print_usage(gboolean print_ver)
fprintf(output, " separator=/t|/s|<char> 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 <key>:<value> 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;