summaryrefslogtreecommitdiff
path: root/src/plugins/scripts
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2010-02-26 11:36:41 +0100
committerSebastien Helleu <flashcode@flashtux.org>2010-02-26 11:36:41 +0100
commit873bcfc9f05c3bd6f15b6f1a16cdabe5d164c787 (patch)
treea135bede8ffdfe95b2e8faa8ad968434aa37e318 /src/plugins/scripts
parenteabf21098d88061799709b9ff3cf5eeb90029dd6 (diff)
downloadweechat-873bcfc9f05c3bd6f15b6f1a16cdabe5d164c787.zip
Add command line option "-s" (or "--no-script") to start WeeChat without loading any script
Diffstat (limited to 'src/plugins/scripts')
-rw-r--r--src/plugins/scripts/script.c25
1 files changed, 19 insertions, 6 deletions
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,