diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2011-11-07 17:06:56 +0100 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2011-11-07 17:06:56 +0100 |
commit | 5f9be5cc7ac635208c5b5802cb34733c3254c061 (patch) | |
tree | 5af45729f9afcd68a12edd535f995e0fac2bba9d /src | |
parent | e8e5ad66cc94a70e6ee3520fb95d70b265f2c469 (diff) | |
download | weechat-5f9be5cc7ac635208c5b5802cb34733c3254c061.zip |
core: display error in command /buffer if arguments are wrong (bug #34180)
Diffstat (limited to 'src')
-rw-r--r-- | src/core/wee-command.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/core/wee-command.c b/src/core/wee-command.c index 6d438498b..7ddb55edf 100644 --- a/src/core/wee-command.c +++ b/src/core/wee-command.c @@ -872,6 +872,14 @@ COMMAND_CALLBACK(buffer) gui_buffer_switch_by_number (gui_current_window, target_buffer); } + else + { + /* invalid number */ + gui_chat_printf (NULL, + _("%sError: incorrect buffer number"), + gui_chat_prefix[GUI_CHAT_PREFIX_ERROR]); + return WEECHAT_RC_OK; + } return WEECHAT_RC_OK; } @@ -889,6 +897,14 @@ COMMAND_CALLBACK(buffer) gui_buffer_switch_by_number (gui_current_window, target_buffer); } + else + { + /* invalid number */ + gui_chat_printf (NULL, + _("%sError: incorrect buffer number"), + gui_chat_prefix[GUI_CHAT_PREFIX_ERROR]); + return WEECHAT_RC_OK; + } return WEECHAT_RC_OK; } @@ -916,6 +932,14 @@ COMMAND_CALLBACK(buffer) } } } + else + { + /* invalid number */ + gui_chat_printf (NULL, + _("%sError: incorrect buffer number"), + gui_chat_prefix[GUI_CHAT_PREFIX_ERROR]); + return WEECHAT_RC_OK; + } return WEECHAT_RC_OK; } @@ -937,6 +961,12 @@ COMMAND_CALLBACK(buffer) gui_window_switch_to_buffer (gui_current_window, ptr_buffer, 1); } + gui_chat_printf (NULL, + _("%sError: unknown option for \"%s\" " + "command"), + gui_chat_prefix[GUI_CHAT_PREFIX_ERROR], + "buffer"); + return WEECHAT_RC_OK; } |