Modified -C command-line handling and added to SNMP

This commit is contained in:
Olof hagsand 2023-08-23 10:52:47 +02:00
parent c101799e74
commit 124afb8788
6 changed files with 20 additions and 16 deletions

View file

@ -613,9 +613,7 @@ main(int argc,
case 'l': /* Log destination */
break; /* see above */
case 'C': /* Explicitly dump configuration */
if (!strlen(optarg))
usage(h, argv[0]);
if ((config_dump_format = format_str2int(optarg)) < 0){
if ((config_dump_format = format_str2int(optarg)) == (enum format_enum)-1){
fprintf(stderr, "Unrecognized dump format: %s(expected: xml|json|text)\n", argv[0]);
usage(h, argv[0]);
}