commit d8fc0e8f732886507322b65865e933f663cc720e Author: Will Drewry wad@chromium.org Date: Fri Sep 13 19:47:38 2013 -0500
tlsdate, docs: make -V taken an optional arg to simplify showtime
Update the man pages and simplify the processing of -V and --showtime to share the optional argument path. --- man/tlsdate.1 | 5 +++-- src/tlsdate.c | 7 +++---- 2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/man/tlsdate.1 b/man/tlsdate.1 index 8ce9d18..e34c81d 100644 --- a/man/tlsdate.1 +++ b/man/tlsdate.1 @@ -49,8 +49,9 @@ The proxy argument expects HTTP, SOCKS4A or SOCKS5 formatted as followed: The proxy support should not leak DNS requests and is suitable for use with Tor. .IP "-v | --verbose" Provide verbose output -.IP "-V | --showtime" -Show the time retrieved from the remote server +.IP "-V | --showtime [human|raw]" +Show the time retrieved from the remote server in a human-readable format or as +a raw time_t. .IP "-t | --timewarp" If the local clock is before RECENT_COMPILE_DATE; we set the clock to the RECENT_COMPILE_DATE. If the local clock is after RECENT_COMPILE_DATE, we leave diff --git a/src/tlsdate.c b/src/tlsdate.c index c19ef69..26e9432 100644 --- a/src/tlsdate.c +++ b/src/tlsdate.c @@ -132,7 +132,7 @@ main(int argc, char **argv) static struct option long_options[] = { {"verbose", 0, 0, 'v'}, - {"showtime", 2, 0, 'R'}, + {"showtime", 2, 0, 'V'}, {"skip-verification", 0, 0, 's'}, {"help", 0, 0, 'h'}, {"host", 0, 0, 'H'}, @@ -146,15 +146,14 @@ main(int argc, char **argv) {0, 0, 0, 0} };
- c = getopt_long(argc, argv, "vVshH:p:P:nC:tlx:", + c = getopt_long(argc, argv, "vV::shH:p:P:nC:tlx:", long_options, &option_index); if (c == -1) break;
switch (c) { case 'v': verbose = 1; break; - case 'V': showtime = 1; break; - case 'R': showtime = (optarg && 0 == strcmp("raw", optarg) ? 2:1); break; + case 'V': showtime = (optarg && 0 == strcmp("raw", optarg) ? 2:1); break; case 's': ca_racket = 0; break; case 'h': usage(); exit(1); break; case 'H': host = optarg; break;