From 4eb8013fd37f0acaedbcef2c9b0eeadc6c984374 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20Bostr=C3=B6m?= Date: Fri, 13 Jul 2012 12:57:14 +0200 Subject: [PATCH] core: add command line option "-r" (or "--run-command") to run command(s) after startup of WeeChat --- ChangeLog | 4 ++- doc/de/weechat_user.de.txt | 20 ++++++----- doc/en/weechat_user.en.txt | 23 ++++++------ doc/fr/weechat_user.fr.txt | 24 +++++++------ doc/it/weechat_user.it.txt | 25 ++++++++------ po/cs.po | 35 ++++++++++--------- po/de.po | 35 ++++++++++--------- po/es.po | 35 ++++++++++--------- po/fr.po | 71 ++++++++++++++++++++------------------ po/hu.po | 34 +++++++++--------- po/it.po | 35 ++++++++++--------- po/ja.po | 35 ++++++++++--------- po/pl.po | 35 ++++++++++--------- po/pt_BR.po | 34 +++++++++--------- po/ru.po | 34 +++++++++--------- po/weechat.pot | 34 +++++++++--------- src/core/wee-command.c | 31 +++++++++++------ src/core/wee-command.h | 2 +- src/core/weechat.c | 51 ++++++++++++++++++--------- src/core/weechat.h | 1 + 20 files changed, 338 insertions(+), 260 deletions(-) diff --git a/ChangeLog b/ChangeLog index 259212c71..9af7aceff 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,12 +1,14 @@ WeeChat ChangeLog ================= Sébastien Helleu -v0.3.9-dev, 2012-07-09 +v0.3.9-dev, 2012-07-13 Version 0.3.9 (under dev!) -------------------------- +* core: add command line option "-r" (or "--run-command") to run command(s) + after startup of WeeChat * core: fix refresh of bar items "buffer_filter" and "scroll" in root bars (bug #36816) * core: add function "hook_set" in plugin API, add "subplugin" in hooks (set by diff --git a/doc/de/weechat_user.de.txt b/doc/de/weechat_user.de.txt index 23630b1c8..a16cf80af 100644 --- a/doc/de/weechat_user.de.txt +++ b/doc/de/weechat_user.de.txt @@ -305,7 +305,7 @@ WeeChat starten Befehlszeile: -a, --no-connect:: - deaktiviert das automatische Verbinden mit den Servern beim Start von WeeChat + deaktiviert das automatische Verbinden mit den Servern beim Start von WeeChat. -c, --colors:: Zeigt die Standardfarben im Terminal an. @@ -316,25 +316,29 @@ Befehlszeile: Sollte das Verzeichnis nicht existieren wird es beim Start angelegt. -h, --help:: - zeigt einen Hilfstext an + zeigt einen Hilfstext an. -k, --keys:: - zeigt die Standard-Tastaturbelegung an + zeigt die Standard-Tastaturbelegung an. -l, --license:: - zeigt die Lizenz von WeeChat an + zeigt die Lizenz von WeeChat an. -p, --no-plugin:: - unterbindet das Laden der Erweiterungen beim Programmstart + unterbindet das Laden der Erweiterungen beim Programmstart. + +// TRANSLATION MISSING +-r, --run-command:: + Run command(s) after startup (many commands can be separated by semicolons). -s, --no-script:: - Skripten werden beim Programmstart nicht geladen + Skripten werden beim Programmstart nicht geladen. -v, --version:: - zeigt die Version von WeeChat an + zeigt die Version von WeeChat an. plugin:option:: - Option für Erweiterung (siehe Dokumentation für weitere Einzelheiten) + Option für Erweiterung (siehe Dokumentation für weitere Einzelheiten). Um WeeChat zu starten muss folgender Befehl ausgeführt werden: diff --git a/doc/en/weechat_user.en.txt b/doc/en/weechat_user.en.txt index af0bdada8..f0b814b2f 100644 --- a/doc/en/weechat_user.en.txt +++ b/doc/en/weechat_user.en.txt @@ -306,36 +306,39 @@ Running WeeChat Command line arguments: -a, --no-connect:: - Disable auto-connect to servers when WeeChat is starting + Disable auto-connect to servers when WeeChat is starting. -c, --colors:: - Display default colors in terminal + Display default colors in terminal. -d, --dir 'path':: Set path as home for WeeChat (used for configuration files, logs, user plugins and scripts), default value is '~/.weechat' (note: directory is - created if not found by WeeChat) + created if not found by WeeChat). -h, --help:: - Display help + Display help. -k, --keys:: - Display WeeChat default keys + Display WeeChat default keys. -l, --license:: - Display WeeChat license + Display WeeChat license. -p, --no-plugin:: - Disable plugins auto-load + Disable plugins auto-load. + +-r, --run-command:: + Run command(s) after startup (many commands can be separated by semicolons). -s, --no-script:: - Disable scripts auto-load + Disable scripts auto-load. -v, --version:: - Display WeeChat version + Display WeeChat version. plugin:option:: - Option for plugin (see doc for each plugin) + Option for plugin (see doc for each plugin). To start WeeChat, issue this command: diff --git a/doc/fr/weechat_user.fr.txt b/doc/fr/weechat_user.fr.txt index c26e330a4..577bfc784 100644 --- a/doc/fr/weechat_user.fr.txt +++ b/doc/fr/weechat_user.fr.txt @@ -313,37 +313,41 @@ Lancer WeeChat Paramètres de ligne de commande : -a, --no-connect:: - Supprimer la connexion automatique aux serveurs lors du démarrage + Supprimer la connexion automatique aux serveurs lors du démarrage. -c, --colors:: - Afficher les couleurs par défaut du terminal + Afficher les couleurs par défaut du terminal. -d, --dir 'path':: Définir le répertoire comme étant la base de WeeChat (utilisé pour les fichiers de configuration, logs, extensions et scripts de l'utilisateur), la valeur par défaut est '~/.weechat' (note : - le répertoire est créé s'il n'est pas trouvé par WeeChat) + le répertoire est créé s'il n'est pas trouvé par WeeChat). -h, --help:: - Afficher l'aide + Afficher l'aide. -k, --keys:: - Afficher les touches par défaut de WeeChat + Afficher les touches par défaut de WeeChat. -l, --license:: - Afficher la licence de WeeChat + Afficher la licence de WeeChat. -p, --no-plugin:: - Supprimer le chargement automatique des extensions au démarrage + Supprimer le chargement automatique des extensions au démarrage. + +-r, --run-command:: + Lancer la/les commande(s) après le démarrage (plusieurs commandes peuvent + être séparées par des points-virgules). -s, --no-script:: - Supprimer le chargement automatique des scripts au démarrage + Supprimer le chargement automatique des scripts au démarrage. -v, --version:: - Afficher la version de WeeChat + Afficher la version de WeeChat. plugin:option:: - Option pour l'extension (voir la documentation de chaque extension) + Option pour l'extension (voir la documentation de chaque extension). Pour lancer WeeChat, tapez cette commande : diff --git a/doc/it/weechat_user.it.txt b/doc/it/weechat_user.it.txt index c8889f151..0ea492488 100644 --- a/doc/it/weechat_user.it.txt +++ b/doc/it/weechat_user.it.txt @@ -314,36 +314,41 @@ Esecuzione di WeeChat Argomenti a riga di comando: -a, --no-connect:: - Disabilita la connessione automatica ai server all'avvio di WeeChat + Disabilita la connessione automatica ai server all'avvio di WeeChat. -c, --colors:: - Mostra i colori prefefiniti nel terminale + Mostra i colori prefefiniti nel terminale. +// TRANSLATION MISSING -d, --dir 'path':: Imposta una cartella come home per WeeChat (utilizzata per i file di configurazione, log, plugin e script dell'utente), il valore predefinito - è ~/.weechat + è ~/.weechat (note: directory is created if not found by WeeChat). -h, --help:: - Mostra l'aiuto + Mostra l'aiuto. -k, --keys:: - Mostra i tasti predefiniti di WeeChat + Mostra i tasti predefiniti di WeeChat. -l, --license:: - Mostra la licenza di WeeChat + Mostra la licenza di WeeChat. -p, --no-plugin:: - Disabilita il caricamento automatico dei plugin + Disabilita il caricamento automatico dei plugin. + +// TRANSLATION MISSING +-r, --run-command:: + Run command(s) after startup (many commands can be separated by semicolons). -s, --no-script:: - Disabilita il caricamento automatico dei script + Disabilita il caricamento automatico dei script. -v, --version:: - Mostra la versione di WeeChat + Mostra la versione di WeeChat. plugin:option:: - Opzione per il plugin (consultare la documentazione per ogni plugin) + Opzione per il plugin (consultare la documentazione per ogni plugin). Per avviare WeeChat, digitare questo comando: diff --git a/po/cs.po b/po/cs.po index 7f0530d0e..c5f56250e 100644 --- a/po/cs.po +++ b/po/cs.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.9-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2012-07-07 13:35+0200\n" +"POT-Creation-Date: 2012-07-13 10:55+0200\n" "PO-Revision-Date: 2012-06-03 09:49+0200\n" "Last-Translator: Jiri Golembiovsky \n" "Language-Team: weechat-dev \n" @@ -43,23 +43,26 @@ 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" -" -c, --colors display default colors in terminal\n" -" -d, --dir set WeeChat home directory (default: ~/.weechat)\n" -" -h, --help this help\n" -" -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" -" to server with url like:\n" -" irc[6][s]://[nickname[:password]@]irc.example.org[:port]" +" -a, --no-connect disable auto-connect to servers at startup\n" +" -c, --colors display default colors in terminal\n" +" -d, --dir set WeeChat home directory (default: ~/.weechat)\n" +" -h, --help this help\n" +" -k, --keys display WeeChat default keys\n" +" -l, --license display WeeChat license\n" +" -p, --no-plugin don't load any plugin at startup\n" +" -r, --run-command run command(s) after startup\n" +" (many commands can be separated by semicolons)\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" +" to server with url like:\n" +" irc[6][s]://[nickname[:password]@]irc.example.org[:port]" "[/#channel1][,#channel2[...]]\n" -" (look at plugins documentation for more information\n" -" about possible options)\n" +" (look at plugins documentation for more information\n" +" about possible options)\n" msgstr "" " -a, --no-connect vypne automatické připojení k serverům při startu\n" " -c, --colors zobrazí výchozí barvy v terminálu\n" diff --git a/po/de.po b/po/de.po index 6e15e17ae..6cb19d86e 100644 --- a/po/de.po +++ b/po/de.po @@ -23,7 +23,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.7-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2012-07-07 13:35+0200\n" +"POT-Creation-Date: 2012-07-13 10:55+0200\n" "PO-Revision-Date: 2012-06-30 14:28+0100\n" "Last-Translator: Nils Görs \n" "Language-Team: German \n" @@ -51,23 +51,26 @@ 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" -" -c, --colors display default colors in terminal\n" -" -d, --dir set WeeChat home directory (default: ~/.weechat)\n" -" -h, --help this help\n" -" -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" -" to server with url like:\n" -" irc[6][s]://[nickname[:password]@]irc.example.org[:port]" +" -a, --no-connect disable auto-connect to servers at startup\n" +" -c, --colors display default colors in terminal\n" +" -d, --dir set WeeChat home directory (default: ~/.weechat)\n" +" -h, --help this help\n" +" -k, --keys display WeeChat default keys\n" +" -l, --license display WeeChat license\n" +" -p, --no-plugin don't load any plugin at startup\n" +" -r, --run-command run command(s) after startup\n" +" (many commands can be separated by semicolons)\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" +" to server with url like:\n" +" irc[6][s]://[nickname[:password]@]irc.example.org[:port]" "[/#channel1][,#channel2[...]]\n" -" (look at plugins documentation for more information\n" -" about possible options)\n" +" (look at plugins documentation for more information\n" +" about possible options)\n" msgstr "" " -a, --no-connect deaktiviert das automatische Verbinden mit den Servern, " "beim Start von WeeChat\n" diff --git a/po/es.po b/po/es.po index 72c381fad..3466a3e40 100644 --- a/po/es.po +++ b/po/es.po @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.9-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2012-07-07 13:35+0200\n" +"POT-Creation-Date: 2012-07-13 10:55+0200\n" "PO-Revision-Date: 2012-06-03 09:49+0200\n" "Last-Translator: Elián Hanisch \n" "Language-Team: weechat-dev \n" @@ -45,23 +45,26 @@ 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" -" -c, --colors display default colors in terminal\n" -" -d, --dir set WeeChat home directory (default: ~/.weechat)\n" -" -h, --help this help\n" -" -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" -" to server with url like:\n" -" irc[6][s]://[nickname[:password]@]irc.example.org[:port]" +" -a, --no-connect disable auto-connect to servers at startup\n" +" -c, --colors display default colors in terminal\n" +" -d, --dir set WeeChat home directory (default: ~/.weechat)\n" +" -h, --help this help\n" +" -k, --keys display WeeChat default keys\n" +" -l, --license display WeeChat license\n" +" -p, --no-plugin don't load any plugin at startup\n" +" -r, --run-command run command(s) after startup\n" +" (many commands can be separated by semicolons)\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" +" to server with url like:\n" +" irc[6][s]://[nickname[:password]@]irc.example.org[:port]" "[/#channel1][,#channel2[...]]\n" -" (look at plugins documentation for more information\n" -" about possible options)\n" +" (look at plugins documentation for more information\n" +" about possible options)\n" msgstr "" " -a, --no-connect desactivar la autoconexión de los servidores al inicio\n" " -c, --colors muestra los colores predeterminados en la terminal\n" diff --git a/po/fr.po b/po/fr.po index 992a7b727..733bd5e8c 100644 --- a/po/fr.po +++ b/po/fr.po @@ -21,8 +21,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.9-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2012-07-07 13:35+0200\n" -"PO-Revision-Date: 2012-07-07 13:35+0200\n" +"POT-Creation-Date: 2012-07-13 10:55+0200\n" +"PO-Revision-Date: 2012-07-13 10:57+0200\n" "Last-Translator: Sebastien Helleu \n" "Language-Team: weechat-dev \n" "Language: French\n" @@ -45,41 +45,46 @@ msgid "Usage: %s [option...] [plugin:option...]\n" msgstr "Utilisation: %s [option...] [extension:option...]\n" msgid "" -" -a, --no-connect disable auto-connect to servers at startup\n" -" -c, --colors display default colors in terminal\n" -" -d, --dir set WeeChat home directory (default: ~/.weechat)\n" -" -h, --help this help\n" -" -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" -" to server with url like:\n" -" irc[6][s]://[nickname[:password]@]irc.example.org[:port]" +" -a, --no-connect disable auto-connect to servers at startup\n" +" -c, --colors display default colors in terminal\n" +" -d, --dir set WeeChat home directory (default: ~/.weechat)\n" +" -h, --help this help\n" +" -k, --keys display WeeChat default keys\n" +" -l, --license display WeeChat license\n" +" -p, --no-plugin don't load any plugin at startup\n" +" -r, --run-command run command(s) after startup\n" +" (many commands can be separated by semicolons)\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" +" to server with url like:\n" +" irc[6][s]://[nickname[:password]@]irc.example.org[:port]" "[/#channel1][,#channel2[...]]\n" -" (look at plugins documentation for more information\n" -" about possible options)\n" +" (look at plugins documentation for more information\n" +" about possible options)\n" msgstr "" -" -a, --no-connect désactiver l'auto-connexion aux serveurs au démarrage\n" -" -c, --colors afficher les couleurs par défaut du terminal\n" -" -d, --dir définir le répertoire de base pour WeeChat (défaut: ~/." +" -a, --no-connect désactiver l'auto-connexion aux serveurs au démarrage\n" +" -c, --colors afficher les couleurs par défaut du terminal\n" +" -d, --dir définir le répertoire de base pour WeeChat (défaut: ~/." "weechat)\n" -" -h, --help cette aide\n" -" -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" -" à un serveur avec une url comme:\n" -" irc[6][s]://[pseudo[:mot_passe]@]irc.example.org[:port][/" -"#canal1][,#canal2[...]]\n" -" (consulter la documentation des extensions pour plus " +" -h, --help cette aide\n" +" -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" +" -r, --run-command lancer la/les commande(s) après le démarrage\n" +" (plusieurs commandes peuvent être séparées par des " +"points-virgules)\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" +" à un serveur avec une url comme:\n" +" irc[6][s]://[pseudo[:mot_passe]@]irc.example.org[:port]" +"[/#canal1][,#canal2[...]]\n" +" (consulter la documentation des extensions pour plus " "d'information\n" -" sur les options possibles)\n" +" sur les options possibles)\n" #. TRANSLATORS: first "%s" is "weechat" #, c-format diff --git a/po/hu.po b/po/hu.po index ed3111c54..6c6b22d66 100644 --- a/po/hu.po +++ b/po/hu.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.9-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2012-07-07 13:35+0200\n" +"POT-Creation-Date: 2012-07-13 10:55+0200\n" "PO-Revision-Date: 2012-06-03 09:49+0200\n" "Last-Translator: Andras Voroskoi \n" "Language-Team: weechat-dev \n" @@ -45,22 +45,24 @@ msgstr "" #, fuzzy msgid "" -" -a, --no-connect disable auto-connect to servers at startup\n" -" -c, --colors display default colors in terminal\n" -" -d, --dir set WeeChat home directory (default: ~/.weechat)\n" -" -h, --help this help\n" -" -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" -" to server with url like:\n" -" irc[6][s]://[nickname[:password]@]irc.example.org[:port]" +" -a, --no-connect disable auto-connect to servers at startup\n" +" -c, --colors display default colors in terminal\n" +" -d, --dir set WeeChat home directory (default: ~/.weechat)\n" +" -h, --help this help\n" +" -k, --keys display WeeChat default keys\n" +" -l, --license display WeeChat license\n" +" -p, --no-plugin don't load any plugin at startup\n" +" -r, --run-command run command(s) after startup\n" +" (many commands can be separated by semicolons)\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" +" to server with url like:\n" +" irc[6][s]://[nickname[:password]@]irc.example.org[:port]" "[/#channel1][,#channel2[...]]\n" -" (look at plugins documentation for more information\n" -" about possible options)\n" +" (look at plugins documentation for more information\n" +" about possible options)\n" msgstr "" " -a, --no-connect automatikus csatlakozás a szerverekhez tiltása\n" " -c, --config beállítófájl opcióinak mutatása\n" diff --git a/po/it.po b/po/it.po index 7db290522..d6b3528cb 100644 --- a/po/it.po +++ b/po/it.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.9-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2012-07-07 13:35+0200\n" +"POT-Creation-Date: 2012-07-13 10:55+0200\n" "PO-Revision-Date: 2012-06-03 09:49+0200\n" "Last-Translator: Marco Paolone \n" "Language-Team: weechat-dev \n" @@ -43,23 +43,26 @@ 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" -" -c, --colors display default colors in terminal\n" -" -d, --dir set WeeChat home directory (default: ~/.weechat)\n" -" -h, --help this help\n" -" -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" -" to server with url like:\n" -" irc[6][s]://[nickname[:password]@]irc.example.org[:port]" +" -a, --no-connect disable auto-connect to servers at startup\n" +" -c, --colors display default colors in terminal\n" +" -d, --dir set WeeChat home directory (default: ~/.weechat)\n" +" -h, --help this help\n" +" -k, --keys display WeeChat default keys\n" +" -l, --license display WeeChat license\n" +" -p, --no-plugin don't load any plugin at startup\n" +" -r, --run-command run command(s) after startup\n" +" (many commands can be separated by semicolons)\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" +" to server with url like:\n" +" irc[6][s]://[nickname[:password]@]irc.example.org[:port]" "[/#channel1][,#channel2[...]]\n" -" (look at plugins documentation for more information\n" -" about possible options)\n" +" (look at plugins documentation for more information\n" +" about possible options)\n" msgstr "" " -a, --no-connect disabilita la connessione automatica all'avvio\n" " -c, --colors mostra i colori predefiniti nel terminale\n" diff --git a/po/ja.po b/po/ja.po index f6493024e..540b08765 100644 --- a/po/ja.po +++ b/po/ja.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.9-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2012-07-07 13:35+0200\n" +"POT-Creation-Date: 2012-07-13 10:55+0200\n" "PO-Revision-Date: 2012-06-03 09:49+0200\n" "Last-Translator: AYANOKOUZI, Ryuunosuke \n" "Language-Team: Japanese \n" @@ -43,23 +43,26 @@ msgstr "" msgid "Usage: %s [option...] [plugin:option...]\n" msgstr "使い方: %s [オプション...] [プラグイン:オプション...]\n" +#, fuzzy msgid "" -" -a, --no-connect disable auto-connect to servers at startup\n" -" -c, --colors display default colors in terminal\n" -" -d, --dir set WeeChat home directory (default: ~/.weechat)\n" -" -h, --help this help\n" -" -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" -" to server with url like:\n" -" irc[6][s]://[nickname[:password]@]irc.example.org[:port]" +" -a, --no-connect disable auto-connect to servers at startup\n" +" -c, --colors display default colors in terminal\n" +" -d, --dir set WeeChat home directory (default: ~/.weechat)\n" +" -h, --help this help\n" +" -k, --keys display WeeChat default keys\n" +" -l, --license display WeeChat license\n" +" -p, --no-plugin don't load any plugin at startup\n" +" -r, --run-command run command(s) after startup\n" +" (many commands can be separated by semicolons)\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" +" to server with url like:\n" +" irc[6][s]://[nickname[:password]@]irc.example.org[:port]" "[/#channel1][,#channel2[...]]\n" -" (look at plugins documentation for more information\n" -" about possible options)\n" +" (look at plugins documentation for more information\n" +" about possible options)\n" msgstr "" " -a, --no-connect 起動時にサーバに自動接続しない\n" " -c, --colors ターミナルにデフォルトの色を表示\n" diff --git a/po/pl.po b/po/pl.po index 048ba3604..f330e62ce 100644 --- a/po/pl.po +++ b/po/pl.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.9-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2012-07-07 13:35+0200\n" +"POT-Creation-Date: 2012-07-13 10:55+0200\n" "PO-Revision-Date: 2012-06-03 09:49+0200\n" "Last-Translator: Krzysztof Korościk \n" "Language-Team: weechat-dev \n" @@ -45,23 +45,26 @@ 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" -" -c, --colors display default colors in terminal\n" -" -d, --dir set WeeChat home directory (default: ~/.weechat)\n" -" -h, --help this help\n" -" -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" -" to server with url like:\n" -" irc[6][s]://[nickname[:password]@]irc.example.org[:port]" +" -a, --no-connect disable auto-connect to servers at startup\n" +" -c, --colors display default colors in terminal\n" +" -d, --dir set WeeChat home directory (default: ~/.weechat)\n" +" -h, --help this help\n" +" -k, --keys display WeeChat default keys\n" +" -l, --license display WeeChat license\n" +" -p, --no-plugin don't load any plugin at startup\n" +" -r, --run-command run command(s) after startup\n" +" (many commands can be separated by semicolons)\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" +" to server with url like:\n" +" irc[6][s]://[nickname[:password]@]irc.example.org[:port]" "[/#channel1][,#channel2[...]]\n" -" (look at plugins documentation for more information\n" -" about possible options)\n" +" (look at plugins documentation for more information\n" +" about possible options)\n" msgstr "" " -a, --no-connect wyłącza automatyczne łączenie się z serwerem przy " "uruchomieniu\n" diff --git a/po/pt_BR.po b/po/pt_BR.po index 767bf56df..cadc8c9fc 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.9-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2012-07-07 13:35+0200\n" +"POT-Creation-Date: 2012-07-13 10:55+0200\n" "PO-Revision-Date: 2012-06-03 09:49+0200\n" "Last-Translator: Sergio Durigan Junior \n" "Language-Team: weechat-dev \n" @@ -69,22 +69,24 @@ msgstr "Uso: %s [opção...] [plugin:opção...]\n" #, fuzzy msgid "" -" -a, --no-connect disable auto-connect to servers at startup\n" -" -c, --colors display default colors in terminal\n" -" -d, --dir set WeeChat home directory (default: ~/.weechat)\n" -" -h, --help this help\n" -" -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" -" to server with url like:\n" -" irc[6][s]://[nickname[:password]@]irc.example.org[:port]" +" -a, --no-connect disable auto-connect to servers at startup\n" +" -c, --colors display default colors in terminal\n" +" -d, --dir set WeeChat home directory (default: ~/.weechat)\n" +" -h, --help this help\n" +" -k, --keys display WeeChat default keys\n" +" -l, --license display WeeChat license\n" +" -p, --no-plugin don't load any plugin at startup\n" +" -r, --run-command run command(s) after startup\n" +" (many commands can be separated by semicolons)\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" +" to server with url like:\n" +" irc[6][s]://[nickname[:password]@]irc.example.org[:port]" "[/#channel1][,#channel2[...]]\n" -" (look at plugins documentation for more information\n" -" about possible options)\n" +" (look at plugins documentation for more information\n" +" about possible options)\n" msgstr "" " -a, --no-connect desabilita a auto-conexão a servidores durante a " "inicialização\n" diff --git a/po/ru.po b/po/ru.po index 95425642d..7d99a570b 100644 --- a/po/ru.po +++ b/po/ru.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.9-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2012-07-07 13:35+0200\n" +"POT-Creation-Date: 2012-07-13 10:55+0200\n" "PO-Revision-Date: 2012-06-03 09:49+0200\n" "Last-Translator: Aleksey V Zapparov AKA ixti \n" "Language-Team: weechat-dev \n" @@ -48,22 +48,24 @@ msgstr "Использование: %s [опция...] [расширение:о #, fuzzy msgid "" -" -a, --no-connect disable auto-connect to servers at startup\n" -" -c, --colors display default colors in terminal\n" -" -d, --dir set WeeChat home directory (default: ~/.weechat)\n" -" -h, --help this help\n" -" -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" -" to server with url like:\n" -" irc[6][s]://[nickname[:password]@]irc.example.org[:port]" +" -a, --no-connect disable auto-connect to servers at startup\n" +" -c, --colors display default colors in terminal\n" +" -d, --dir set WeeChat home directory (default: ~/.weechat)\n" +" -h, --help this help\n" +" -k, --keys display WeeChat default keys\n" +" -l, --license display WeeChat license\n" +" -p, --no-plugin don't load any plugin at startup\n" +" -r, --run-command run command(s) after startup\n" +" (many commands can be separated by semicolons)\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" +" to server with url like:\n" +" irc[6][s]://[nickname[:password]@]irc.example.org[:port]" "[/#channel1][,#channel2[...]]\n" -" (look at plugins documentation for more information\n" -" about possible options)\n" +" (look at plugins documentation for more information\n" +" about possible options)\n" msgstr "" " -a, --no-connect не подключаться автоматически при запуске\n" " -c, --config отобразить параметры конфигурации\n" diff --git a/po/weechat.pot b/po/weechat.pot index 4e940258c..16c1eaf3e 100644 --- a/po/weechat.pot +++ b/po/weechat.pot @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2012-07-07 13:35+0200\n" +"POT-Creation-Date: 2012-07-13 10:55+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -29,22 +29,24 @@ msgid "Usage: %s [option...] [plugin:option...]\n" msgstr "" msgid "" -" -a, --no-connect disable auto-connect to servers at startup\n" -" -c, --colors display default colors in terminal\n" -" -d, --dir set WeeChat home directory (default: ~/.weechat)\n" -" -h, --help this help\n" -" -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" -" to server with url like:\n" -" irc[6][s]://[nickname[:password]@]irc.example.org[:port]" +" -a, --no-connect disable auto-connect to servers at startup\n" +" -c, --colors display default colors in terminal\n" +" -d, --dir set WeeChat home directory (default: ~/.weechat)\n" +" -h, --help this help\n" +" -k, --keys display WeeChat default keys\n" +" -l, --license display WeeChat license\n" +" -p, --no-plugin don't load any plugin at startup\n" +" -r, --run-command run command(s) after startup\n" +" (many commands can be separated by semicolons)\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" +" to server with url like:\n" +" irc[6][s]://[nickname[:password]@]irc.example.org[:port]" "[/#channel1][,#channel2[...]]\n" -" (look at plugins documentation for more information\n" -" about possible options)\n" +" (look at plugins documentation for more information\n" +" about possible options)\n" msgstr "" #. TRANSLATORS: first "%s" is "weechat" diff --git a/src/core/wee-command.c b/src/core/wee-command.c index 6a1b2a565..c4ace0a42 100644 --- a/src/core/wee-command.c +++ b/src/core/wee-command.c @@ -6214,23 +6214,18 @@ command_init () } /* - * command_startup: execute command at startup + * command_exec_list: execute command list */ void -command_startup (int plugins_loaded) +command_exec_list (const char *command_list) { - char *command, **commands, **ptr_cmd; + char **commands, **ptr_cmd; struct t_gui_buffer *weechat_buffer; - if (plugins_loaded) - command = CONFIG_STRING(config_startup_command_after_plugins); - else - command = CONFIG_STRING(config_startup_command_before_plugins); - - if (command && command[0]) + if (command_list && command_list[0]) { - commands = string_split_command (command, ';'); + commands = string_split_command (command_list, ';'); if (commands) { weechat_buffer = gui_buffer_search_main (); @@ -6242,3 +6237,19 @@ command_startup (int plugins_loaded) } } } + +/* + * command_startup: execute command at startup + */ + +void +command_startup (int plugins_loaded) +{ + if (plugins_loaded) + { + command_exec_list(CONFIG_STRING(config_startup_command_after_plugins)); + command_exec_list(weechat_startup_commands); + } + else + command_exec_list(CONFIG_STRING(config_startup_command_before_plugins)); +} diff --git a/src/core/wee-command.h b/src/core/wee-command.h index fd4971c8f..e0f277373 100644 --- a/src/core/wee-command.h +++ b/src/core/wee-command.h @@ -62,7 +62,7 @@ struct t_gui_buffer; extern int command_reload (void *data, struct t_gui_buffer *buffer, int argc, char **argv, char **argv_eol); extern void command_init (); -extern void command_startup (int plugins_looaded); +extern void command_startup (int plugins_loaded); extern void command_version_display (struct t_gui_buffer *buffer, int send_to_buffer_as_input, int translated_string); diff --git a/src/core/weechat.c b/src/core/weechat.c index 9dc332fb3..d51eabd64 100644 --- a/src/core/weechat.c +++ b/src/core/weechat.c @@ -91,6 +91,7 @@ int weechat_server_cmd_line = 0; /* at least 1 server on cmd line */ int weechat_auto_load_plugins = 1; /* auto load plugins */ int weechat_plugin_no_dlclose = 0; /* remove calls to dlclose for libs */ /* (useful when using valgrind) */ +char *weechat_startup_commands = NULL; /* startup commands (-r flag) */ /* @@ -136,22 +137,24 @@ weechat_display_usage (char *exec_name) exec_name, exec_name); string_iconv_fprintf (stdout, "\n"); string_iconv_fprintf (stdout, - _(" -a, --no-connect disable auto-connect to servers at startup\n" - " -c, --colors display default colors in terminal\n" - " -d, --dir set WeeChat home directory (default: ~/.weechat)\n" - " -h, --help this help\n" - " -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" - " to server with url like:\n" - " irc[6][s]://[nickname[:password]@]" + _(" -a, --no-connect disable auto-connect to servers at startup\n" + " -c, --colors display default colors in terminal\n" + " -d, --dir set WeeChat home directory (default: ~/.weechat)\n" + " -h, --help this help\n" + " -k, --keys display WeeChat default keys\n" + " -l, --license display WeeChat license\n" + " -p, --no-plugin don't load any plugin at startup\n" + " -r, --run-command run command(s) after startup\n" + " (many commands can be separated by semicolons)\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" + " to server with url like:\n" + " irc[6][s]://[nickname[:password]@]" "irc.example.org[:port][/#channel1][,#channel2[...]]\n" - " (look at plugins documentation for more information\n" - " about possible options)\n")); + " (look at plugins documentation for more information\n" + " about possible options)\n")); string_iconv_fprintf(stdout, "\n"); } @@ -223,7 +226,7 @@ weechat_parse_args (int argc, char *argv[]) string_iconv_fprintf (stderr, _("Error: missing argument for \"%s\" " "option\n"), - "--dir"); + argv[i]); weechat_shutdown (EXIT_FAILURE, 0); } } @@ -262,6 +265,20 @@ weechat_parse_args (int argc, char *argv[]) { weechat_auto_load_plugins = 0; } + else if ((strcmp (argv[i], "-r") == 0) + || (strcmp (argv[i], "--run-command") == 0)) + { + if (i + 1 < argc) + weechat_startup_commands = strdup (argv[++i]); + else + { + string_iconv_fprintf (stderr, + _("Error: missing argument for \"%s\" " + "option\n"), + argv[i]); + weechat_shutdown (EXIT_FAILURE, 0); + } + } else if (strcmp (argv[i], "--upgrade") == 0) { weechat_upgrading = 1; @@ -466,7 +483,7 @@ main (int argc, char *argv[]) command_startup (0); /* command executed before plugins */ plugin_init (weechat_auto_load_plugins, /* init plugin interface(s) */ argc, argv); - command_startup (1); /* command executed after plugins */ + command_startup (1); /* commands executed after plugins */ if (!weechat_upgrading) gui_layout_window_apply (gui_layout_windows, -1); /* apply win layout */ if (weechat_upgrading) diff --git a/src/core/weechat.h b/src/core/weechat.h index 2c70855cd..87c968b1a 100644 --- a/src/core/weechat.h +++ b/src/core/weechat.h @@ -108,6 +108,7 @@ extern int weechat_quit; extern char *weechat_home; extern char *weechat_local_charset; extern int weechat_plugin_no_dlclose; +extern char *weechat_startup_commands; extern void weechat_shutdown (int return_code, int crash);