Add command line option "-s" (or "--no-script") to start WeeChat without loading any script

This commit is contained in:
Sebastien Helleu 2010-02-26 11:36:41 +01:00
parent eabf21098d
commit 873bcfc9f0
14 changed files with 59 additions and 22 deletions

View File

@ -1,13 +1,15 @@
WeeChat ChangeLog
=================
FlashCode <flashcode@flashtux.org>
v0.3.2-dev, 2010-02-24
v0.3.2-dev, 2010-02-26
Version 0.3.2 (under dev!)
--------------------------
* core: add signal "day_changed"
* core: add new command /mute
* core: add command line option "-s" (or "--no-script") to start WeeChat
without loading any script
* core: remove unneeded space after time on each line if option
weechat.look.buffer_time_format is set to empty value (bug #28751)
* core: add option "switch_active_buffer_previous" for command /input

View File

@ -1,4 +1,4 @@
.TH WEECHAT 1 "January 2010" "FlashCode"
.TH WEECHAT 1 "February 2010" "FlashCode"
.SH NAME
weechat-curses \- Wee Enhanced Environment for Chat (Curses version)
@ -43,6 +43,10 @@ display program license
.br
don't load any plugin at startup
.TP
.B \-s, \-\-no\-script
.br
don't load any script at startup
.TP
.B \-v, \-\-version
.br
display WeeChat version

View File

@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.2-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2010-02-23 10:39+0100\n"
"POT-Creation-Date: 2010-02-26 11:22+0100\n"
"PO-Revision-Date: 2010-02-23 10:43+0100\n"
"Last-Translator: Jiri Golembiovsky <golemj@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -27,6 +27,7 @@ msgstr ""
msgid "Usage: %s [option...] [plugin:option...]\n"
msgstr "Použití: %s [volba...] [plugin:volba...]\n"
#, fuzzy
msgid ""
" -a, --no-connect disable auto-connect to servers at startup\n"
" -d, --dir <path> set WeeChat home directory (default: ~/.weechat)\n"
@ -34,6 +35,7 @@ msgid ""
" -k, --keys display WeeChat default keys\n"
" -l, --license display WeeChat license\n"
" -p, --no-plugin don't load any plugin at startup\n"
" -s, --no-script don't load any script at startup\n"
" -v, --version display WeeChat version\n"
" plugin:option option for plugin\n"
" for example, irc plugin can connect\n"

View File

@ -10,7 +10,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.2-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2010-02-23 10:39+0100\n"
"POT-Creation-Date: 2010-02-26 11:22+0100\n"
"PO-Revision-Date: 2010-02-23 10:43+0100\n"
"Last-Translator: Nils G <weechatter@arcor.de>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -33,6 +33,7 @@ msgstr ""
msgid "Usage: %s [option...] [plugin:option...]\n"
msgstr "Aufruf: %s [Option...] [Erweiterung:Option...]\n"
#, fuzzy
msgid ""
" -a, --no-connect disable auto-connect to servers at startup\n"
" -d, --dir <path> set WeeChat home directory (default: ~/.weechat)\n"
@ -40,6 +41,7 @@ msgid ""
" -k, --keys display WeeChat default keys\n"
" -l, --license display WeeChat license\n"
" -p, --no-plugin don't load any plugin at startup\n"
" -s, --no-script don't load any script at startup\n"
" -v, --version display WeeChat version\n"
" plugin:option option for plugin\n"
" for example, irc plugin can connect\n"

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.2-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2010-02-23 10:39+0100\n"
"POT-Creation-Date: 2010-02-26 11:22+0100\n"
"PO-Revision-Date: 2010-02-23 10:43+0100\n"
"Last-Translator: Elián Hanisch <lambdae2@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -29,6 +29,7 @@ msgstr ""
msgid "Usage: %s [option...] [plugin:option...]\n"
msgstr "Uso: %s [opción...] [plugin:opción...]\n"
#, fuzzy
msgid ""
" -a, --no-connect disable auto-connect to servers at startup\n"
" -d, --dir <path> set WeeChat home directory (default: ~/.weechat)\n"
@ -36,6 +37,7 @@ msgid ""
" -k, --keys display WeeChat default keys\n"
" -l, --license display WeeChat license\n"
" -p, --no-plugin don't load any plugin at startup\n"
" -s, --no-script don't load any script at startup\n"
" -v, --version display WeeChat version\n"
" plugin:option option for plugin\n"
" for example, irc plugin can connect\n"

View File

@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.2-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2010-02-23 10:39+0100\n"
"PO-Revision-Date: 2010-02-23 10:43+0100\n"
"POT-Creation-Date: 2010-02-26 11:22+0100\n"
"PO-Revision-Date: 2010-02-26 11:27+0100\n"
"Last-Translator: FlashCode <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"MIME-Version: 1.0\n"
@ -34,6 +34,7 @@ msgid ""
" -k, --keys display WeeChat default keys\n"
" -l, --license display WeeChat license\n"
" -p, --no-plugin don't load any plugin at startup\n"
" -s, --no-script don't load any script at startup\n"
" -v, --version display WeeChat version\n"
" plugin:option option for plugin\n"
" for example, irc plugin can connect\n"
@ -50,6 +51,7 @@ msgstr ""
" -k, --keys afficher les touches WeeChat par défaut\n"
" -l, --license afficher la licence WeeChat\n"
" -p, --no-plugin ne charger aucune extension au démarrage\n"
" -s, --no-script ne charger aucun script au démarrage\n"
" -v, --version afficher la version de WeeChat\n"
" extension:option option pour une extension\n"
" par exemple, l'extension irc peut se connecter\n"

View File

@ -12,7 +12,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.2-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2010-02-23 10:39+0100\n"
"POT-Creation-Date: 2010-02-26 11:22+0100\n"
"PO-Revision-Date: 2010-02-23 10:43+0100\n"
"Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -41,6 +41,7 @@ msgid ""
" -k, --keys display WeeChat default keys\n"
" -l, --license display WeeChat license\n"
" -p, --no-plugin don't load any plugin at startup\n"
" -s, --no-script don't load any script at startup\n"
" -v, --version display WeeChat version\n"
" plugin:option option for plugin\n"
" for example, irc plugin can connect\n"

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Weechat 0.3.2-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2010-02-23 10:39+0100\n"
"POT-Creation-Date: 2010-02-26 11:22+0100\n"
"PO-Revision-Date: 2010-02-23 10:43+0100\n"
"Last-Translator: Marco Paolone <marcopaolone@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -29,6 +29,7 @@ msgstr ""
msgid "Usage: %s [option...] [plugin:option...]\n"
msgstr "Utilizzo: %s [opzione...] [plugin:opzione...]\n"
#, fuzzy
msgid ""
" -a, --no-connect disable auto-connect to servers at startup\n"
" -d, --dir <path> set WeeChat home directory (default: ~/.weechat)\n"
@ -36,6 +37,7 @@ msgid ""
" -k, --keys display WeeChat default keys\n"
" -l, --license display WeeChat license\n"
" -p, --no-plugin don't load any plugin at startup\n"
" -s, --no-script don't load any script at startup\n"
" -v, --version display WeeChat version\n"
" plugin:option option for plugin\n"
" for example, irc plugin can connect\n"

View File

@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.0-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2010-02-23 10:39+0100\n"
"POT-Creation-Date: 2010-02-26 11:22+0100\n"
"PO-Revision-Date: 2010-02-23 10:43+0100\n"
"Last-Translator: Krzysztof Koroscik <soltys@szluug.org>\n"
"Language-Team: Polish\n"
@ -31,6 +31,7 @@ msgstr ""
msgid "Usage: %s [option...] [plugin:option...]\n"
msgstr "Użycie: %s [argumenty...] [wtyczka:opcje...]\n"
#, fuzzy
msgid ""
" -a, --no-connect disable auto-connect to servers at startup\n"
" -d, --dir <path> set WeeChat home directory (default: ~/.weechat)\n"
@ -38,6 +39,7 @@ msgid ""
" -k, --keys display WeeChat default keys\n"
" -l, --license display WeeChat license\n"
" -p, --no-plugin don't load any plugin at startup\n"
" -s, --no-script don't load any script at startup\n"
" -v, --version display WeeChat version\n"
" plugin:option option for plugin\n"
" for example, irc plugin can connect\n"

View File

@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.2-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2010-02-23 10:39+0100\n"
"POT-Creation-Date: 2010-02-26 11:22+0100\n"
"PO-Revision-Date: 2010-02-23 10:43+0100\n"
"Last-Translator: Pavel Shevchuk <stlwrt@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -37,6 +37,7 @@ msgid ""
" -k, --keys display WeeChat default keys\n"
" -l, --license display WeeChat license\n"
" -p, --no-plugin don't load any plugin at startup\n"
" -s, --no-script don't load any script at startup\n"
" -v, --version display WeeChat version\n"
" plugin:option option for plugin\n"
" for example, irc plugin can connect\n"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2010-02-23 10:39+0100\n"
"POT-Creation-Date: 2010-02-26 11:22+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -33,6 +33,7 @@ msgid ""
" -k, --keys display WeeChat default keys\n"
" -l, --license display WeeChat license\n"
" -p, --no-plugin don't load any plugin at startup\n"
" -s, --no-script don't load any script at startup\n"
" -v, --version display WeeChat version\n"
" plugin:option option for plugin\n"
" for example, irc plugin can connect\n"

View File

@ -111,6 +111,7 @@ weechat_display_usage (char *exec_name)
" -k, --keys display WeeChat default keys\n"
" -l, --license display WeeChat license\n"
" -p, --no-plugin don't load any plugin at startup\n"
" -s, --no-script don't load any script at startup\n"
" -v, --version display WeeChat version\n"
" plugin:option option for plugin\n"
" for example, irc plugin can connect\n"

View File

@ -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++;

View File

@ -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,