summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/plugin.c10
-rw-r--r--src/plugins/scripts/script.c25
2 files changed, 25 insertions, 10 deletions
diff --git a/src/plugins/plugin.c b/src/plugins/plugin.c
index 5cebfe8ea..38e72c022 100644
--- a/src/plugins/plugin.c
+++ b/src/plugins/plugin.c
@@ -586,10 +586,12 @@ plugin_load (const char *filename)
argc = 0;
for (i = 0; i < plugin_argc; i++)
{
- if ((string_strcasecmp (plugin_argv[i], "-a") == 0)
- || (string_strcasecmp (plugin_argv[i], "--no-connect") == 0)
- || (string_strcasecmp (plugin_argv[i], "--upgrade") == 0)
- || (string_strncasecmp (plugin_argv[i], name, strlen (name)) == 0))
+ if ((strcmp (plugin_argv[i], "-a") == 0)
+ || (strcmp (plugin_argv[i], "--no-connect") == 0)
+ || (strcmp (plugin_argv[i], "-s") == 0)
+ || (strcmp (plugin_argv[i], "--no-script") == 0)
+ || (strcmp (plugin_argv[i], "--upgrade") == 0)
+ || (strncmp (plugin_argv[i], name, strlen (name)) == 0))
{
argv[argc] = plugin_argv[i];
argc++;
diff --git a/src/plugins/scripts/script.c b/src/plugins/scripts/script.c
index b08f4df98..20b8712fe 100644
--- a/src/plugins/scripts/script.c
+++ b/src/plugins/scripts/script.c
@@ -209,7 +209,7 @@ script_init (struct t_weechat_plugin *weechat_plugin,
{
char *string, *completion;
char signal_name[128];
- int length, i, upgrading;
+ int length, i, upgrading, auto_load_scripts;
/* read script configuration */
script_config_read (weechat_plugin);
@@ -298,16 +298,29 @@ script_init (struct t_weechat_plugin *weechat_plugin,
weechat_plugin->name);
weechat_hook_signal (signal_name, callback_signal_script_action, NULL);
- /* autoload scripts */
- script_auto_load (weechat_plugin, callback_load_file);
-
- /* actions after upgrade */
+ /* parse arguments */
upgrading = 0;
+ auto_load_scripts = 1;
for (i = 0; i < argc; i++)
{
- if (weechat_strcasecmp (argv[i], "--upgrade") == 0)
+ if (strcmp (argv[i], "--upgrade") == 0)
+ {
upgrading = 1;
+ }
+ else if ((strcmp (argv[i], "-s") == 0)
+ || (strcmp (argv[i], "--no-script") == 0))
+ {
+ auto_load_scripts = 0;
+ }
}
+
+ /* autoload scripts */
+ if (auto_load_scripts)
+ {
+ script_auto_load (weechat_plugin, callback_load_file);
+ }
+
+ /* set buffer callbacks after upgrade */
if (upgrading)
{
script_upgrade_set_buffer_callbacks (weechat_plugin,