Commit e41f74e3 authored by Niels Möller's avatar Niels Möller
Browse files

* src/lsh.c (main_argp_parser): Check if the action list is empty

at ARGP_KEY_END.
* src/lshg.c (main_argp_parser): Likewise.

Rev: src/lsh.c:1.132
Rev: src/lshg.c:1.6
parent 790ac30c
......@@ -832,6 +832,9 @@ main_argp_parser(int key, char *arg, struct argp_state *state)
lsh_string_free(tmp);
}
/* We can't add the gateway action immediately when the -G
* option is encountered, as we need the name and port of the
* remote machine (self->super.remote) first. */
if (self->start_gateway)
{
struct local_info *gateway;
......@@ -857,6 +860,12 @@ main_argp_parser(int key, char *arg, struct argp_state *state)
(make_listen_local(self->super.backend, gateway)));
}
if (object_queue_is_empty(&self->super.actions))
{
argp_error(state, "No actions given.");
break;
}
/* Start background poll */
RANDOM_POLL_BACKGROUND(self->random->poller);
......
......@@ -196,6 +196,12 @@ main_argp_parser(int key, char *arg, struct argp_state *state)
assert(self->super.user);
assert(self->super.remote);
if (object_queue_is_empty(&self->super.actions))
{
argp_error(state, "No actions given.");
break;
}
self->gateway = make_gateway_address(self->super.local_user,
self->super.user,
self->super.remote);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment