From cf827580f516f18e0c0d0ef0f379a6c62cf9f8bb Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Fri, 21 Feb 2014 13:37:58 +0100 Subject: [PATCH] lua: return WEECHAT_RC_ERROR in command /lua if arguments are wrong/missing --- src/plugins/lua/weechat-lua.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/plugins/lua/weechat-lua.c b/src/plugins/lua/weechat-lua.c index 8a6acea57..7f3b5ae3f 100644 --- a/src/plugins/lua/weechat-lua.c +++ b/src/plugins/lua/weechat-lua.c @@ -644,6 +644,8 @@ weechat_lua_command_cb (void *data, struct t_gui_buffer *buffer, { weechat_lua_unload_all (); } + else + return WEECHAT_RC_ERROR; } else { @@ -693,12 +695,7 @@ weechat_lua_command_cb (void *data, struct t_gui_buffer *buffer, lua_quiet = 0; } else - { - weechat_printf (NULL, - weechat_gettext ("%s%s: unknown option for " - "command \"%s\""), - weechat_prefix ("error"), LUA_PLUGIN_NAME, "lua"); - } + return WEECHAT_RC_ERROR; } return WEECHAT_RC_OK;