From 1c0efc71c6a3cabda7f7b804f09a425c950c2bfd Mon Sep 17 00:00:00 2001 From: strk Date: Tue, 24 Feb 2009 20:41:27 +0000 Subject: [PATCH] User commands can just return 0 on syntax error, the command handler takes care of printing the error message and help in that case. git-svn-id: svn+ssh://svn.savannah.nongnu.org/linphone/trunk@273 3f6dc0c8-ddfe-455d-9043-3cd528dc4637 --- linphone/console/commands.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/linphone/console/commands.c b/linphone/console/commands.c index efb580192..686ee7a44 100644 --- a/linphone/console/commands.c +++ b/linphone/console/commands.c @@ -710,12 +710,12 @@ lpc_cmd_proxy(LinphoneCore *lc, char *args) linphonec_proxy_show(lc, atoi(arg2)); } } - else return 0; // syntax error + else return 0; /* syntax error */ } else { - linphonec_out("Syntax error - see 'help proxy'\n"); + return 0; /* syntax error */ } return 1; @@ -740,8 +740,7 @@ lpc_cmd_ipv6(LinphoneCore *lc, char *arg1) { if ( ! arg1 ) { - linphonec_out("Syntax error - see 'help ipv6'\n"); - return 1; + return 0; /* syntax error */ } if (strcmp(arg1,"status")==0) @@ -760,7 +759,7 @@ lpc_cmd_ipv6(LinphoneCore *lc, char *arg1) } else { - linphonec_out("Syntax error - see 'help ipv6'\n"); + return 0; /* syntax error */ } return 1; } @@ -768,8 +767,7 @@ lpc_cmd_ipv6(LinphoneCore *lc, char *arg1) static int lpc_cmd_soundcard(LinphoneCore *lc, char *cmd){ int i; if (cmd==NULL){ - linphonec_out("Syntax error - see 'help soundcard'\n"); - return 1; + return 0; /* syntax error */ } if (strcmp(cmd,"list")==0){ const char **dev=linphone_core_get_sound_devices(lc); @@ -803,7 +801,7 @@ static int lpc_cmd_soundcard(LinphoneCore *lc, char *cmd){ return 1; } } - linphonec_out("Syntax error - see 'help soundcard'\n"); + return 0; /* syntax error */ } return 1; }