From 8137fe6d45762844248300de2a030e96042b1975 Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Mon, 25 Nov 2013 02:03:23 +0100 Subject: Allows shorthands for birdc noninteractive commands. --- client/client.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'client') diff --git a/client/client.c b/client/client.c index a9d0096d..b938f344 100644 --- a/client/client.c +++ b/client/client.c @@ -137,6 +137,21 @@ submit_server_command(char *cmd) server_send(cmd); } +static inline void +submit_init_command(char *cmd_raw) +{ + char *cmd = cmd_expand(cmd_raw); + + if (!cmd) + { + cleanup(); + exit(0); + } + + submit_server_command(cmd); + free(cmd); +} + void submit_command(char *cmd_raw) { @@ -165,7 +180,7 @@ init_commands(void) { /* First transition - client received hello from BIRD and there is waiting initial command */ - submit_server_command(init_cmd); + submit_init_command(init_cmd); init_cmd = NULL; return; } -- cgit v1.2.3