summaryrefslogtreecommitdiffstats
path: root/src/utils/kcatalogprint
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/kcatalogprint')
-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) {