charon-cmd: pass arguments to all handlers, even if already handled

This commit is contained in:
Martin Willi 2013-03-26 17:38:02 +01:00
parent 9dfd9275f0
commit 7bcd96e43d
1 changed files with 5 additions and 2 deletions

View File

@ -254,6 +254,8 @@ static void handle_arguments(int argc, char *argv[])
} }
while (TRUE) while (TRUE)
{ {
bool handled = FALSE;
opt = getopt_long(argc, argv, "", long_opts, NULL); opt = getopt_long(argc, argv, "", long_opts, NULL);
switch (opt) switch (opt)
{ {
@ -266,8 +268,9 @@ static void handle_arguments(int argc, char *argv[])
printf("%s, strongSwan %s\n", "charon-cmd", VERSION); printf("%s, strongSwan %s\n", "charon-cmd", VERSION);
exit(0); exit(0);
default: default:
if (conn->handle(conn, opt, optarg) || handled |= conn->handle(conn, opt, optarg);
creds->handle(creds, opt, optarg)) handled |= creds->handle(creds, opt, optarg);
if (handled)
{ {
continue; continue;
} }