summaryrefslogtreecommitdiff
path: root/src/core/commands.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/commands.c')
-rw-r--r--src/core/commands.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/core/commands.c b/src/core/commands.c
index 8f02db89..1dfd8b71 100644
--- a/src/core/commands.c
+++ b/src/core/commands.c
@@ -436,8 +436,24 @@ static void cmd_cd(const char *data)
g_free(str);
}
+static void cmd_rehash(const char *data)
+{
+ char *fname;
+
+ fname = *data != '\0' ? g_strdup(data) :
+ g_strdup_printf("%s/.irssi/config", g_get_home_dir());
+ settings_reread(fname);
+ g_free(fname);
+}
+
+static void cmd_save(const char *data)
+{
+ settings_save(*data != '\0' ? data : NULL);
+}
+
void commands_init(void)
{
+ commands = NULL;
cmdget_funcs = NULL;
current_command = NULL;
@@ -448,6 +464,8 @@ void commands_init(void)
command_bind("eval", NULL, (SIGNAL_FUNC) cmd_eval);
command_bind("cd", NULL, (SIGNAL_FUNC) cmd_cd);
+ command_bind("rehash", NULL, (SIGNAL_FUNC) cmd_rehash);
+ command_bind("save", NULL, (SIGNAL_FUNC) cmd_save);
}
void commands_deinit(void)
@@ -459,4 +477,6 @@ void commands_deinit(void)
command_unbind("eval", (SIGNAL_FUNC) cmd_eval);
command_unbind("cd", (SIGNAL_FUNC) cmd_cd);
+ command_unbind("rehash", (SIGNAL_FUNC) cmd_rehash);
+ command_unbind("save", (SIGNAL_FUNC) cmd_save);
}