diff options
author | LemonBoy <thatlemon@gmail.com> | 2016-09-11 16:59:21 +0200 |
---|---|---|
committer | LemonBoy <thatlemon@gmail.com> | 2016-09-11 16:59:21 +0200 |
commit | b2424f31933309a0b3dfa6cb541c2917443a38d4 (patch) | |
tree | 25becee828cac42c7f34b3aec5263c5f7ddb0e2f /src/perl/perl-fe.c | |
parent | e4f8abc973872d5a7b2de98d269a924b97d428ab (diff) | |
download | irssi-b2424f31933309a0b3dfa6cb541c2917443a38d4.zip |
Add a '-autorun' switch to /script reset
This way we reload all the scripts in the autorun folder.
Diffstat (limited to 'src/perl/perl-fe.c')
-rw-r--r-- | src/perl/perl-fe.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/perl/perl-fe.c b/src/perl/perl-fe.c index 04305b63..396c80b7 100644 --- a/src/perl/perl-fe.c +++ b/src/perl/perl-fe.c @@ -119,8 +119,20 @@ static void cmd_script_unload(const char *data) static void cmd_script_reset(const char *data) { + void *free_arg; + GHashTable *optlist; + + if (!cmd_get_params(data, &free_arg, 0 | PARAM_FLAG_OPTIONS, + "script reset", &optlist)) + return; + perl_scripts_deinit(); perl_scripts_init(); + + if (g_hash_table_lookup(optlist, "autorun") != NULL) + perl_scripts_autorun(); + + cmd_params_free(free_arg); } static void cmd_script_list(void) @@ -251,6 +263,7 @@ void fe_perl_init(void) command_bind("script list", NULL, (SIGNAL_FUNC) cmd_script_list); command_bind("load", NULL, (SIGNAL_FUNC) cmd_load); command_set_options("script exec", "permanent"); + command_set_options("script reset", "autorun"); signal_add("script error", (SIGNAL_FUNC) sig_script_error); signal_add("complete command script load", (SIGNAL_FUNC) sig_complete_load); |