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

* src/client.c (client_options2remote): Deleted command.

(client_argp_parser): Don't call make_address_info_c.

* src/client.h (client_options): Replaced remote attribute with a
plain NUL-termianted string, and renamed to target.

Rev: src/client.c:1.149
Rev: src/client.h:1.55
parent 9252815d
......@@ -548,7 +548,7 @@ init_client_options(struct client_options *self,
self->not = 0;
self->port = NULL;
self->remote = NULL;
self->target = NULL;
self->local_user = self->user = getenv(ENV_LOGNAME);
......@@ -577,19 +577,6 @@ init_client_options(struct client_options *self,
object_queue_init(&self->actions);
}
/* Host to connect to */
DEFINE_COMMAND(client_options2remote)
(struct command *s UNUSED,
struct lsh_object *a,
struct command_continuation *c,
struct exception_handler *e UNUSED)
{
CAST_SUBTYPE(client_options, options, a);
trace("client.c: client_options2remote\n");
COMMAND_RETURN(c, options->remote);
}
/* Host to connect to */
DEFINE_COMMAND(client_options2actions)
(struct command *s UNUSED,
......@@ -1261,18 +1248,8 @@ client_argp_parser(int key, char *arg, struct argp_state *state)
break;
case ARGP_KEY_ARG:
if (!state->arg_num)
{
if (options->port)
options->remote = make_address_info_c(arg, options->port, 0);
else
options->remote = make_address_info_c(arg, "ssh", 22);
if (!options->remote)
argp_error(state, "Invalid port or service '%s'.",
options->port ? options->port : "22");
break;
}
options->target = arg;
else
/* Let the next case parse it. */
return ARGP_ERR_UNKNOWN;
......
......@@ -144,8 +144,8 @@ make_client_x11_display(const char *display, struct lsh_string *fake);
(exit_code . "int *")
(not . int)
(port . "char *")
(remote object address_info)
(port . "const char *")
(target . "const char *")
(local_user . "char *")
(user . "char *")
......@@ -198,9 +198,6 @@ client_parse_forward_arg(char *arg,
uint32_t *listen_port,
struct address_info **target);
extern struct command client_options2remote;
#define OPTIONS2REMOTE (&client_options2remote.super)
extern struct command client_options2actions;
#define OPTIONS2ACTIONS (&client_options2actions.super)
......
Supports Markdown
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