diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2023-03-19 17:42:12 +0100 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2023-03-19 17:42:12 +0100 |
commit | e4f181beb3279eef22a58f8e79c57264321cbd5a (patch) | |
tree | 9fe1f2888345a0dcfe4833a25c979f6433d6fa80 /src/core | |
parent | 6bd49dd595c766ca3105666c8d7d6c07920f47ad (diff) | |
download | weechat-e4f181beb3279eef22a58f8e79c57264321cbd5a.zip |
core: display an error with `/bar add` when the bar already exists
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/wee-command.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/core/wee-command.c b/src/core/wee-command.c index d1e3ec953..a79faefc0 100644 --- a/src/core/wee-command.c +++ b/src/core/wee-command.c @@ -277,6 +277,15 @@ COMMAND_CALLBACK(bar) if (string_strcmp (argv[1], "add") == 0) { COMMAND_MIN_ARGS(8, "add"); + ptr_bar = gui_bar_search (argv[2]); + if (ptr_bar) + { + gui_chat_printf (NULL, + _("%sBar \"%s\" already exists"), + gui_chat_prefix[GUI_CHAT_PREFIX_ERROR], + argv[2]); + return WEECHAT_RC_OK; + } pos_condition = strchr (argv[3], ','); if (pos_condition) { |