summaryrefslogtreecommitdiffstats
path: root/src/utils/knsec3hash/knsec3hash.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-12 04:45:07 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-12 04:45:07 +0000
commit0335817ced71e8355806ea0445aa3b105a22364c (patch)
treedffe735f2668a4728d8567feaf7ccb2d73076bac /src/utils/knsec3hash/knsec3hash.c
parentAdding upstream version 3.3.9. (diff)
downloadknot-b06fb54b583d390dc852dfce1a7eac3c1a9c0852.tar.xz
knot-b06fb54b583d390dc852dfce1a7eac3c1a9c0852.zip
Adding upstream version 3.4.0.upstream/3.4.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/utils/knsec3hash/knsec3hash.c')
-rw-r--r--src/utils/knsec3hash/knsec3hash.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/utils/knsec3hash/knsec3hash.c b/src/utils/knsec3hash/knsec3hash.c
index a7bac97..a18498d 100644
--- a/src/utils/knsec3hash/knsec3hash.c
+++ b/src/utils/knsec3hash/knsec3hash.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2022 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
+/* Copyright (C) 2023 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -36,7 +36,7 @@
*/
static void print_help(void)
{
- printf("Usage: " PROGRAM_NAME " <salt> <algorithm> <iterations> <domain-name>\n");
+ printf("Usage: " PROGRAM_NAME " [-h | -V] <salt> <algorithm> <iterations> <domain-name>\n");
printf("Example: " PROGRAM_NAME " c01dcafe 1 10 knot-dns.cz\n");
printf("Alternative usage: "PROGRAM_NAME " <algorithm> <flags> <iterations> <salt> <domain-name>\n");
printf("Example: " PROGRAM_NAME " 1 0 10 c01dcafe knot-dns.cz\n");
@@ -103,19 +103,19 @@ static bool parse_nsec3_params(dnssec_nsec3_params_t *params, const char *salt_s
int main(int argc, char *argv[])
{
struct option options[] = {
- { "help", no_argument, NULL, 'h' },
- { "version", no_argument, NULL, 'V' },
+ { "help", no_argument, NULL, 'h' },
+ { "version", optional_argument, NULL, 'V' },
{ NULL }
};
int opt = 0;
- while ((opt = getopt_long(argc, argv, "hV", options, NULL)) != -1) {
+ while ((opt = getopt_long(argc, argv, "hV::", options, NULL)) != -1) {
switch(opt) {
case 'h':
print_help();
return EXIT_SUCCESS;
case 'V':
- print_version(PROGRAM_NAME);
+ print_version(PROGRAM_NAME, optarg != NULL);
return EXIT_SUCCESS;
default:
print_help();