mirror of
https://github.com/weechat/weechat.git
synced 2026-07-10 19:53:13 +02:00
scripts: add option "version" in script commands (closes #1075)
This commit is contained in:
@@ -678,6 +678,10 @@ weechat_perl_command_cb (const void *pointer, void *data,
|
||||
{
|
||||
weechat_perl_unload_all ();
|
||||
}
|
||||
else if (weechat_strcasecmp (argv[1], "version") == 0)
|
||||
{
|
||||
plugin_script_display_interpreter (weechat_perl_plugin, 0);
|
||||
}
|
||||
else
|
||||
WEECHAT_COMMAND_ERROR;
|
||||
}
|
||||
@@ -823,31 +827,6 @@ weechat_perl_signal_debug_dump_cb (const void *pointer, void *data,
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* Display infos about external libraries used.
|
||||
*/
|
||||
|
||||
int
|
||||
weechat_perl_signal_debug_libs_cb (const void *pointer, void *data,
|
||||
const char *signal,
|
||||
const char *type_data, void *signal_data)
|
||||
{
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
(void) signal;
|
||||
(void) type_data;
|
||||
(void) signal_data;
|
||||
|
||||
#ifdef PERL_VERSION_STRING
|
||||
weechat_printf (NULL, " %s: %s", PERL_PLUGIN_NAME, PERL_VERSION_STRING);
|
||||
#else
|
||||
weechat_printf (NULL, " %s: (?)", PERL_PLUGIN_NAME);
|
||||
#endif /* PERL_VERSION_STRING */
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* Timer for executing actions.
|
||||
*/
|
||||
@@ -977,6 +956,17 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
|
||||
|
||||
weechat_perl_plugin = plugin;
|
||||
|
||||
/* set interpreter name and version */
|
||||
weechat_hashtable_set (plugin->variables, "interpreter_name",
|
||||
plugin->name);
|
||||
#ifdef PERL_VERSION_STRING
|
||||
weechat_hashtable_set (plugin->variables, "interpreter_version",
|
||||
PERL_VERSION_STRING);
|
||||
#else
|
||||
weechat_hashtable_set (plugin->variables, "interpreter_version",
|
||||
"");
|
||||
#endif /* PERL_VERSION_STRING */
|
||||
|
||||
#ifndef MULTIPLICITY
|
||||
perl_main = perl_alloc ();
|
||||
|
||||
@@ -999,7 +989,6 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
|
||||
init.callback_hdata = &weechat_perl_hdata_cb;
|
||||
init.callback_infolist = &weechat_perl_infolist_cb;
|
||||
init.callback_signal_debug_dump = &weechat_perl_signal_debug_dump_cb;
|
||||
init.callback_signal_debug_libs = &weechat_perl_signal_debug_libs_cb;
|
||||
init.callback_signal_script_action = &weechat_perl_signal_script_action_cb;
|
||||
init.callback_load_file = &weechat_perl_load_cb;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user