1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-05 09:13:14 +02:00

Added new options look_charset_decode/look_charset_encode and /unset command.

This commit is contained in:
Sebastien Helleu
2005-01-02 02:10:10 +00:00
parent 9adb547b36
commit b2c5317e17
24 changed files with 1708 additions and 1296 deletions
+43
View File
@@ -97,6 +97,9 @@ t_weechat_command weechat_commands[] =
{ "unalias", N_("remove an alias"),
N_("alias_name"), N_("alias_name: name of alias to remove"),
1, 1, NULL, weechat_cmd_unalias },
{ "unset", N_("reset config parameters"),
N_("option"), N_("option: name of an option"),
1, 1, NULL, weechat_cmd_unset },
{ "window", N_("manage windows"),
N_("[action]"),
N_("action: action to do:\n"
@@ -1835,6 +1838,46 @@ weechat_cmd_unalias (char *arguments)
return 0;
}
/*
* weechat_cmd_unset: reset options
*/
int
weechat_cmd_unset (char *arguments)
{
t_config_option *ptr_option;
ptr_option = config_option_search (arguments);
if (ptr_option)
{
if (ptr_option->handler_change == NULL)
{
gui_printf (NULL,
_("%s option \"%s\" can not be changed while WeeChat is running\n"),
WEECHAT_ERROR, arguments);
}
else
{
if (config_option_set_value (ptr_option, "") == 0)
{
(void) (ptr_option->handler_change());
gui_printf (NULL, "[%s]\n", config_get_section (ptr_option));
gui_printf (NULL, " %s =\n", arguments);
}
else
gui_printf (NULL, _("%s option \"%s\" can not be reset (use "
"/set command to change this option)\n"),
WEECHAT_ERROR, arguments);
}
}
else
{
gui_printf (NULL, _("%s config option \"%s\" not found\n"),
WEECHAT_ERROR, arguments);
}
return 0;
}
/*
* weechat_cmd_window: manage windows
*/