cpp,tests: Actually parse the --with-secret option

* lang/cpp/tests/run-keylist.cpp (main): Handle --with-secret option.
Print error for unknown option.
--

The --with-secret option was already listed in the help. Now it also
works.

GnuPG-bug-id: 5965
This commit is contained in:
Ingo Klöcker 2022-05-05 17:19:39 +02:00
parent 9e8c8e448e
commit e029fd2735

View File

@ -119,6 +119,9 @@ main (int argc, char **argv)
} else if (!strcmp (*argv, "--locate")) { } else if (!strcmp (*argv, "--locate")) {
argc--; argv++; argc--; argv++;
mode |= KeyListMode::Locate; mode |= KeyListMode::Locate;
} else if (!strcmp (*argv, "--with-secret")) {
argc--; argv++;
mode |= KeyListMode::WithSecret;
} else if (!strcmp (*argv, "--force-extern")) { } else if (!strcmp (*argv, "--force-extern")) {
argc--; argv++; argc--; argv++;
mode |= KeyListMode::ForceExtern; mode |= KeyListMode::ForceExtern;
@ -126,6 +129,7 @@ main (int argc, char **argv)
argc--; argv++; argc--; argv++;
mode |= KeyListMode::LocateExternal; mode |= KeyListMode::LocateExternal;
} else if (!strncmp (*argv, "--", 2)) { } else if (!strncmp (*argv, "--", 2)) {
std::cerr << "Error: Unknown option: " << *argv << std::endl;
show_usage (1); show_usage (1);
} }
} }