diff options
Diffstat (limited to 'bin/dnssec/dnssec-importkey.c')
-rw-r--r-- | bin/dnssec/dnssec-importkey.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/bin/dnssec/dnssec-importkey.c b/bin/dnssec/dnssec-importkey.c index 67502a6939d54..f07f02ecf5b73 100644 --- a/bin/dnssec/dnssec-importkey.c +++ b/bin/dnssec/dnssec-importkey.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2013, 2014 Internet Systems Consortium, Inc. ("ISC") * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -269,6 +269,7 @@ usage(void) { "the key files\n"); fprintf(stderr, " -L ttl: set default key TTL\n"); fprintf(stderr, " -v <verbose level>\n"); + fprintf(stderr, " -V: print version information\n"); fprintf(stderr, " -h: print usage and exit\n"); fprintf(stderr, "Timing options:\n"); fprintf(stderr, " -P date/[+-]offset/none: set/unset key " @@ -306,15 +307,15 @@ main(int argc, char **argv) { isc_commandline_errprint = ISC_FALSE; -#define CMDLINE_FLAGS "D:f:hK:L:P:v:" +#define CMDLINE_FLAGS "D:f:hK:L:P:v:V" while ((ch = isc_commandline_parse(argc, argv, CMDLINE_FLAGS)) != -1) { switch (ch) { case 'D': if (setdel) fatal("-D specified more than once"); - setdel = ISC_TRUE; - del = strtotime(isc_commandline_argument, now, now); + del = strtotime(isc_commandline_argument, + now, now, &setdel); break; case 'K': dir = isc_commandline_argument; @@ -322,17 +323,15 @@ main(int argc, char **argv) { fatal("directory must be non-empty string"); break; case 'L': - if (strcmp(isc_commandline_argument, "none") == 0) - ttl = 0; - else - ttl = strtottl(isc_commandline_argument); + ttl = strtottl(isc_commandline_argument); setttl = ISC_TRUE; break; case 'P': if (setpub) fatal("-P specified more than once"); - setpub = ISC_TRUE; - pub = strtotime(isc_commandline_argument, now, now); + + pub = strtotime(isc_commandline_argument, + now, now, &setpub); break; case 'f': filename = isc_commandline_argument; @@ -348,8 +347,13 @@ main(int argc, char **argv) { program, isc_commandline_option); /* FALLTHROUGH */ case 'h': + /* Does not return. */ usage(); + case 'V': + /* Does not return. */ + version(program); + default: fprintf(stderr, "%s: unhandled option -%c\n", program, isc_commandline_option); |