summaryrefslogtreecommitdiffstats
path: root/src/utils/kcatalogprint/main.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-12 04:45:08 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-12 04:45:08 +0000
commit3ade2b375d3e928a06a39bb5ce48e59ea054f9c8 (patch)
tree23c9115f88363ed22bc4afbeb4901994d036f189 /src/utils/kcatalogprint/main.c
parentReleasing progress-linux version 3.3.9-1~progress7.99u1. (diff)
downloadknot-3ade2b375d3e928a06a39bb5ce48e59ea054f9c8.tar.xz
knot-3ade2b375d3e928a06a39bb5ce48e59ea054f9c8.zip
Merging upstream version 3.4.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/utils/kcatalogprint/main.c')
-rw-r--r--src/utils/kcatalogprint/main.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/utils/kcatalogprint/main.c b/src/utils/kcatalogprint/main.c
index 0172347..85e50b6 100644
--- a/src/utils/kcatalogprint/main.c
+++ b/src/utils/kcatalogprint/main.c
@@ -108,7 +108,7 @@ int main(int argc, char *argv[])
{ "catalog", required_argument, NULL, 'a' },
{ "member", required_argument, NULL, 'm' },
{ "help", no_argument, NULL, 'h' },
- { "version", no_argument, NULL, 'V' },
+ { "version", optional_argument, NULL, 'V' },
{ NULL }
};
@@ -116,7 +116,7 @@ int main(int argc, char *argv[])
signal_init_std();
int opt = 0;
- while ((opt = getopt_long(argc, argv, "c:C:D:a:m:hV", opts, NULL)) != -1) {
+ while ((opt = getopt_long(argc, argv, "c:C:D:a:m:hV::", opts, NULL)) != -1) {
switch (opt) {
case 'c':
if (util_conf_init_file(optarg) != KNOT_EOK) {
@@ -147,7 +147,7 @@ int main(int argc, char *argv[])
print_help();
goto success;
case 'V':
- print_version(PROGRAM_NAME);
+ print_version(PROGRAM_NAME, optarg != NULL);
goto success;
default:
print_help();
@@ -155,13 +155,9 @@ int main(int argc, char *argv[])
}
}
- // Backward compatibility.
if (argc - optind > 0) {
- WARN2("obsolete parameter specified");
- if (util_conf_init_justdb("catalog-db", argv[optind]) != KNOT_EOK) {
- goto failure;
- }
- optind++;
+ print_help();
+ goto failure;
}
if (util_conf_init_default(true) != KNOT_EOK) {