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, ...@@ -548,7 +548,7 @@ init_client_options(struct client_options *self,
self->not = 0; self->not = 0;
self->port = NULL; self->port = NULL;
self->remote = NULL; self->target = NULL;
self->local_user = self->user = getenv(ENV_LOGNAME); self->local_user = self->user = getenv(ENV_LOGNAME);
...@@ -577,19 +577,6 @@ init_client_options(struct client_options *self, ...@@ -577,19 +577,6 @@ init_client_options(struct client_options *self,
object_queue_init(&self->actions); 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 */ /* Host to connect to */
DEFINE_COMMAND(client_options2actions) DEFINE_COMMAND(client_options2actions)
(struct command *s UNUSED, (struct command *s UNUSED,
...@@ -1261,18 +1248,8 @@ client_argp_parser(int key, char *arg, struct argp_state *state) ...@@ -1261,18 +1248,8 @@ client_argp_parser(int key, char *arg, struct argp_state *state)
break; break;
case ARGP_KEY_ARG: case ARGP_KEY_ARG:
if (!state->arg_num) if (!state->arg_num)
{ options->target = arg;
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;
}
else else
/* Let the next case parse it. */ /* Let the next case parse it. */
return ARGP_ERR_UNKNOWN; return ARGP_ERR_UNKNOWN;
......
...@@ -144,8 +144,8 @@ make_client_x11_display(const char *display, struct lsh_string *fake); ...@@ -144,8 +144,8 @@ make_client_x11_display(const char *display, struct lsh_string *fake);
(exit_code . "int *") (exit_code . "int *")
(not . int) (not . int)
(port . "char *") (port . "const char *")
(remote object address_info) (target . "const char *")
(local_user . "char *") (local_user . "char *")
(user . "char *") (user . "char *")
...@@ -198,9 +198,6 @@ client_parse_forward_arg(char *arg, ...@@ -198,9 +198,6 @@ client_parse_forward_arg(char *arg,
uint32_t *listen_port, uint32_t *listen_port,
struct address_info **target); struct address_info **target);
extern struct command client_options2remote;
#define OPTIONS2REMOTE (&client_options2remote.super)
extern struct command client_options2actions; extern struct command client_options2actions;
#define OPTIONS2ACTIONS (&client_options2actions.super) #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