diff --git a/src/core/wee-command.c b/src/core/wee-command.c index 0a382cdf5..6becca420 100644 --- a/src/core/wee-command.c +++ b/src/core/wee-command.c @@ -5447,10 +5447,10 @@ command_proxy_list () COMMAND_CALLBACK(proxy) { - int type; + struct t_proxy *ptr_proxy, *ptr_next_proxy; + char *error, *name; + int type, i; long value; - char *error; - struct t_proxy *ptr_proxy; /* make C compiler happy */ (void) pointer; @@ -5512,24 +5512,22 @@ COMMAND_CALLBACK(proxy) if (string_strcmp (argv[1], "del") == 0) { COMMAND_MIN_ARGS(3, "del"); - if (string_strcmp (argv[2], "-all") == 0) + for (i = 2; i < argc; i++) { - proxy_free_all (); - gui_chat_printf (NULL, _("All proxies have been deleted")); - } - else - { - ptr_proxy = proxy_search (argv[2]); - if (!ptr_proxy) + ptr_proxy = weechat_proxies; + while (ptr_proxy) { - gui_chat_printf (NULL, - _("%sProxy \"%s\" not found"), - gui_chat_prefix[GUI_CHAT_PREFIX_ERROR], - argv[2]); - return WEECHAT_RC_OK; + ptr_next_proxy = ptr_proxy->next_proxy; + if (string_match (ptr_proxy->name, argv[i], 1)) + { + name = strdup (ptr_proxy->name); + proxy_free (ptr_proxy); + gui_chat_printf (NULL, _("Proxy \"%s\" deleted"), name); + if (name) + free (name); + } + ptr_proxy = ptr_next_proxy; } - proxy_free (ptr_proxy); - gui_chat_printf (NULL, _("Proxy deleted")); } return WEECHAT_RC_OK; } @@ -8999,7 +8997,7 @@ command_init () /* TRANSLATORS: only text between angle brackets (eg: "") must be translated */ N_("list" " || add
[ []]" - " || del |-all" + " || del | [|...]" " || set