From 078f549c4a3b625e18f296236c1a3f18e139c1ca Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Fri, 21 Feb 2014 13:39:26 +0100 Subject: rmodifier: return WEECHAT_RC_ERROR in command /rmodifier if arguments are wrong/missing --- src/plugins/rmodifier/rmodifier-command.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) (limited to 'src/plugins/rmodifier/rmodifier-command.c') diff --git a/src/plugins/rmodifier/rmodifier-command.c b/src/plugins/rmodifier/rmodifier-command.c index 753a84f44..8aeb7c260 100644 --- a/src/plugins/rmodifier/rmodifier-command.c +++ b/src/plugins/rmodifier/rmodifier-command.c @@ -121,13 +121,7 @@ rmodifier_command_cb (void *data, struct t_gui_buffer *buffer, int argc, if (weechat_strcasecmp (argv[1], "add") == 0) { if (argc < 6) - { - weechat_printf (NULL, - _("%sError: missing arguments for \"%s\" " - "command"), - weechat_prefix ("error"), "rmodifier"); - return WEECHAT_RC_OK; - } + return WEECHAT_RC_ERROR; ptr_rmodifier = rmodifier_new (argv[2], argv[3], argv_eol[5], argv[4]); if (!ptr_rmodifier) { @@ -158,13 +152,7 @@ rmodifier_command_cb (void *data, struct t_gui_buffer *buffer, int argc, if (weechat_strcasecmp (argv[1], "del") == 0) { if (argc < 3) - { - weechat_printf (NULL, - _("%sError: missing arguments for \"%s\" " - "command"), - weechat_prefix ("error"), "rmodifier"); - return WEECHAT_RC_OK; - } + return WEECHAT_RC_ERROR; if (weechat_strcasecmp (argv[2], "-all") == 0) { count = rmodifier_count; @@ -230,7 +218,7 @@ rmodifier_command_cb (void *data, struct t_gui_buffer *buffer, int argc, return WEECHAT_RC_OK; } - return WEECHAT_RC_OK; + return WEECHAT_RC_ERROR; } /* -- cgit v1.2.3