From d38d033ce74a88cf4d86a28ed72ba24b63d6806b Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Fri, 5 Jul 2013 18:22:10 +0200 Subject: [PATCH] core: add completion "-quit" for command /upgrade A "-dummy" option has been added too, just to prevent accidental completion with "-quit" (which is the first option completed). Thanks to stfn for initial patch. --- doc/de/autogen/user/weechat_commands.txt | 37 ++++++++++++------------ doc/en/autogen/user/weechat_commands.txt | 1 + doc/fr/autogen/user/weechat_commands.txt | 1 + doc/it/autogen/user/weechat_commands.txt | 1 + doc/ja/autogen/user/weechat_commands.txt | 37 ++++++++++++------------ po/cs.po | 4 ++- po/de.po | 5 +++- po/es.po | 4 ++- po/fr.po | 8 +++-- po/hu.po | 4 ++- po/it.po | 4 ++- po/ja.po | 5 +++- po/pl.po | 5 +++- po/pt_BR.po | 4 ++- po/ru.po | 4 ++- po/tr.po | 4 ++- po/weechat.pot | 4 ++- src/core/wee-command.c | 7 ++++- 18 files changed, 89 insertions(+), 50 deletions(-) diff --git a/doc/de/autogen/user/weechat_commands.txt b/doc/de/autogen/user/weechat_commands.txt index c455f61c0..a8616356b 100644 --- a/doc/de/autogen/user/weechat_commands.txt +++ b/doc/de/autogen/user/weechat_commands.txt @@ -658,28 +658,29 @@ Beispiele: ........................................ /upgrade [|-quit] -path_to_binary: Pfad zu einer ausführbaren WeeChat Binärdatei (Standardeinstellung ist die aktuell ausführbare Datei) - -quit: trennt *ALLE* Verbindungen, speichert die aktuelle Sitzung und beendet WeeChat, um den aktuellen Zustand später wiederherstellen (siehe unten) +path_to_binary: path to WeeChat binary (default is current binary) + -dummy: do nothing (option used to prevent accidental completion with "-quit") + -quit: close *ALL* connections, save session and quit WeeChat, which makes possible a delayed restoration (see below) -Dieser Befehl führt ein Upgrade von WeeChat durch und startet die laufende Sitzung neu. Bevor dieser Befehl ausgeführt wird, sollte eine neue Version von WeeChat entweder vorab kompiliert, oder mit einem Paketmanager installiert worden sein. +This command upgrades and reloads a running WeeChat session. The new WeeChat binary must have been compiled or installed with a package manager before running this command. -Hinweis: SSL Verbindungen werden während eines Upgrades unterbrochen, da diese Verbindungen zur Zeit nicht mit GnuTLS gehalten werden können. Nach einem erfolgten Upgrade findet eine automatische Verbindung zu diesen Servern statt. +Note: SSL connections are lost during upgrade, because reload of SSL sessions is currently not possible with GnuTLS. There is automatic reconnection after upgrade. -Der Upgrade Vorgang besteht aus vier Schritten: - 1. Sicherung der Sitzung, in Dateien für Core und Erweiterungen (buffers, history, ..) - 2. alle Erweiterungen werden ausgeschaltet (Konfigurationen *.conf werden gesichert) - 3. Sicherung der WeeChat Konfiguration (weechat.conf) - 4. ausführen der neuen Version von WeeChat und wiederherstellen der Sitzung. +Upgrade process has 4 steps: + 1. save session into files for core and plugins (buffers, history, ..) + 2. unload all plugins (configuration files (*.conf) are written on disk) + 3. save WeeChat configuration (weechat.conf) + 4. execute new WeeChat binary and reload session. -Nutzt man die "-quit" Funktion ist die Abfolge geringfügig anders: - 1. es werden *ALLE* Verbindungen getrennt (irc,xfer,relay, ...) - 2. die Sitzung wird in Dateien gesichert (*.upgrade) - 3. alle Erweiterungen werden ausgeschaltet - 4. die WeeChat Konfiguration wird gesichert - 5. WeeChat wird beendet -Die Sitzung kann zu einem späteren Zeitpunkt wiederhergestellt werden: weechat-curses --upgrade -WICHTIG: Die Sitzung muss mit exakt den selben Konfigurationsdateien wiederhergestellt werden (*.conf) -Es ist möglich die WeeChat-Sitzung auf einem anderen Rechner wiederherzustellen, sofern man den Inhalt des "~/.weechat" Verzeichnisses dorthin kopiert. +With option "-quit", the process is slightly different: + 1. close *ALL* connections (irc, xfer, relay, ...) + 2. save session into files (*.upgrade) + 3. unload all plugins + 4. save WeeChat configuration + 5. quit WeeChat +Then later you can restore session with command: weechat-curses --upgrade +IMPORTANT: you must restore the session with exactly same configuration (files *.conf). +It is possible to restore WeeChat session on another machine if you copy the content of directory "~/.weechat". ........................................ [[command_weechat_uptime]] diff --git a/doc/en/autogen/user/weechat_commands.txt b/doc/en/autogen/user/weechat_commands.txt index c28919610..31c5f171c 100644 --- a/doc/en/autogen/user/weechat_commands.txt +++ b/doc/en/autogen/user/weechat_commands.txt @@ -659,6 +659,7 @@ Examples: /upgrade [|-quit] path_to_binary: path to WeeChat binary (default is current binary) + -dummy: do nothing (option used to prevent accidental completion with "-quit") -quit: close *ALL* connections, save session and quit WeeChat, which makes possible a delayed restoration (see below) This command upgrades and reloads a running WeeChat session. The new WeeChat binary must have been compiled or installed with a package manager before running this command. diff --git a/doc/fr/autogen/user/weechat_commands.txt b/doc/fr/autogen/user/weechat_commands.txt index cb7906f49..e30c04e9f 100644 --- a/doc/fr/autogen/user/weechat_commands.txt +++ b/doc/fr/autogen/user/weechat_commands.txt @@ -659,6 +659,7 @@ Exemples: /upgrade [|-quit] chemin_vers_binaire: chemin vers le binaire WeeChat (par défaut le binaire courant) + -dummy: ne rien faire (option utilisée pour éviter une complétion accidentelle avec "-quit") -quit: fermer *TOUTES* les connexions, sauver la session et quitter, ce qui rend possible une restauration différée (voir ci-dessous) Cette commande met à jour et recharge une session de WeeChat qui tourne. Le nouveau binaire WeeChat doit avoir été compilé ou installé via un gestionnaire de paquet avant de lancer cette commande. diff --git a/doc/it/autogen/user/weechat_commands.txt b/doc/it/autogen/user/weechat_commands.txt index c3c48cb11..3daaaa4f6 100644 --- a/doc/it/autogen/user/weechat_commands.txt +++ b/doc/it/autogen/user/weechat_commands.txt @@ -659,6 +659,7 @@ Esempi: /upgrade [|-quit] path_to_binary: path to WeeChat binary (default is current binary) + -dummy: do nothing (option used to prevent accidental completion with "-quit") -quit: close *ALL* connections, save session and quit WeeChat, which makes possible a delayed restoration (see below) This command upgrades and reloads a running WeeChat session. The new WeeChat binary must have been compiled or installed with a package manager before running this command. diff --git a/doc/ja/autogen/user/weechat_commands.txt b/doc/ja/autogen/user/weechat_commands.txt index 3ae780ae6..8dfa1d684 100644 --- a/doc/ja/autogen/user/weechat_commands.txt +++ b/doc/ja/autogen/user/weechat_commands.txt @@ -658,28 +658,29 @@ option: オプションの名前 ("*" で始めるか終わるかすれば大量 ........................................ /upgrade [|-quit] -path_to_binary: WeeChat バイナリへのパス (デフォルトは現在のバイナリ) - -quit: *すべての*接続を閉じ、セッションを保存して WeeChat を終了。遅延復帰 (詳しくは後述) が可能になります。 +path_to_binary: path to WeeChat binary (default is current binary) + -dummy: do nothing (option used to prevent accidental completion with "-quit") + -quit: close *ALL* connections, save session and quit WeeChat, which makes possible a delayed restoration (see below) -このコマンドは起動中の WeeChat セッションのアップグレードと再読み込みを行います。このコマンドを実行する前に、新しい WeeChat バイナリをコンパイルするか、パッケージマネージャでインストールしなければいけません。 +This command upgrades and reloads a running WeeChat session. The new WeeChat binary must have been compiled or installed with a package manager before running this command. -注意: SSL 接続はアップグレード中に破棄されます、これは今のところ GnuTLS では SSL セッションのリロードができないからです。アップグレードの後に自動的に再接続されます。 +Note: SSL connections are lost during upgrade, because reload of SSL sessions is currently not possible with GnuTLS. There is automatic reconnection after upgrade. -アップグレードは 4 つの手順を踏みます: - 1. コアとプラグイン (バッファ、履歴、...) のセッションをファイルに保存 - 2. 全てのプラグインをアンロード (設定ファイル (*.conf) はディスクに書き込まれます) - 3. WeeChat 設定を保存 (weechat.conf) - 4. 新しい WeeChat バイナリを実行してセッションをリロード。< +Upgrade process has 4 steps: + 1. save session into files for core and plugins (buffers, history, ..) + 2. unload all plugins (configuration files (*.conf) are written on disk) + 3. save WeeChat configuration (weechat.conf) + 4. execute new WeeChat binary and reload session. -オプション "-quit" を使うと、上の挙動が少し変わります: - 1. *すべての*接続を閉じる (irc、xfer、relay、...) - 2. すべてのセッションをファイルに保存 (*.upgrade) - 3. すべてのプラグインをアンロード - 4. WeeChat 設定を保存 - 5. WeeChat を終了 -この後、セッションを回復させるには weechat-curses --upgrade を使ってください。 -重要: 完全に同一の設定で (*.conf ファイルで) セッションを回復させてください。 -"~/.weechat" ディレクトリの内容をコピーすれば異なるマシンで WeeChat のセッションを回復することも可能です。 +With option "-quit", the process is slightly different: + 1. close *ALL* connections (irc, xfer, relay, ...) + 2. save session into files (*.upgrade) + 3. unload all plugins + 4. save WeeChat configuration + 5. quit WeeChat +Then later you can restore session with command: weechat-curses --upgrade +IMPORTANT: you must restore the session with exactly same configuration (files *.conf). +It is possible to restore WeeChat session on another machine if you copy the content of directory "~/.weechat". ........................................ [[command_weechat_uptime]] diff --git a/po/cs.po b/po/cs.po index 75e5fc469..426e4ea3e 100644 --- a/po/cs.po +++ b/po/cs.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.4.2-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2013-07-02 15:35+0200\n" +"POT-Creation-Date: 2013-07-05 18:09+0200\n" "PO-Revision-Date: 2013-06-10 09:13+0200\n" "Last-Translator: Jiri Golembiovsky \n" "Language-Team: weechat-dev \n" @@ -1994,6 +1994,8 @@ msgstr "[]" #, fuzzy msgid "" "path_to_binary: path to WeeChat binary (default is current binary)\n" +" -dummy: do nothing (option used to prevent accidental completion " +"with \"-quit\")\n" " -quit: close *ALL* connections, save session and quit WeeChat, " "which makes possible a delayed restoration (see below)\n" "\n" diff --git a/po/de.po b/po/de.po index 6228e268b..6b07f4476 100644 --- a/po/de.po +++ b/po/de.po @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.4.2-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2013-07-03 13:09+0200\n" +"POT-Creation-Date: 2013-07-05 18:09+0200\n" "PO-Revision-Date: 2013-07-02 22:20+0100\n" "Last-Translator: Nils Görs \n" "Language-Team: German \n" @@ -2215,8 +2215,11 @@ msgstr "Aktualisiert WeeChat ohne die Verbindung zum Server zu trennen" msgid "[|-quit]" msgstr "[|-quit]" +#, fuzzy msgid "" "path_to_binary: path to WeeChat binary (default is current binary)\n" +" -dummy: do nothing (option used to prevent accidental completion " +"with \"-quit\")\n" " -quit: close *ALL* connections, save session and quit WeeChat, " "which makes possible a delayed restoration (see below)\n" "\n" diff --git a/po/es.po b/po/es.po index de8dde245..d80903e6f 100644 --- a/po/es.po +++ b/po/es.po @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.4.2-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2013-07-02 15:35+0200\n" +"POT-Creation-Date: 2013-07-05 18:09+0200\n" "PO-Revision-Date: 2013-07-02 15:57+0200\n" "Last-Translator: Elián Hanisch \n" "Language-Team: weechat-dev \n" @@ -2102,6 +2102,8 @@ msgstr "[|-quit]" #, fuzzy msgid "" "path_to_binary: path to WeeChat binary (default is current binary)\n" +" -dummy: do nothing (option used to prevent accidental completion " +"with \"-quit\")\n" " -quit: close *ALL* connections, save session and quit WeeChat, " "which makes possible a delayed restoration (see below)\n" "\n" diff --git a/po/fr.po b/po/fr.po index 792f5ab84..9c771de06 100644 --- a/po/fr.po +++ b/po/fr.po @@ -21,8 +21,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.4.2-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2013-07-02 15:35+0200\n" -"PO-Revision-Date: 2013-07-02 15:36+0200\n" +"POT-Creation-Date: 2013-07-05 18:09+0200\n" +"PO-Revision-Date: 2013-07-05 18:10+0200\n" "Last-Translator: Sebastien Helleu \n" "Language-Team: weechat-dev \n" "Language: fr\n" @@ -2159,6 +2159,8 @@ msgstr "[|-quit]" msgid "" "path_to_binary: path to WeeChat binary (default is current binary)\n" +" -dummy: do nothing (option used to prevent accidental completion " +"with \"-quit\")\n" " -quit: close *ALL* connections, save session and quit WeeChat, " "which makes possible a delayed restoration (see below)\n" "\n" @@ -2190,6 +2192,8 @@ msgid "" msgstr "" "chemin_vers_binaire: chemin vers le binaire WeeChat (par défaut le binaire " "courant)\n" +" -dummy: ne rien faire (option utilisée pour éviter une " +"complétion accidentelle avec \"-quit\")\n" " -quit: fermer *TOUTES* les connexions, sauver la session et " "quitter, ce qui rend possible une restauration différée (voir ci-dessous)\n" "\n" diff --git a/po/hu.po b/po/hu.po index 4d8a28784..327776b2b 100644 --- a/po/hu.po +++ b/po/hu.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.4.2-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2013-07-02 15:35+0200\n" +"POT-Creation-Date: 2013-07-05 18:09+0200\n" "PO-Revision-Date: 2013-07-02 15:57+0200\n" "Last-Translator: Andras Voroskoi \n" "Language-Team: weechat-dev \n" @@ -1714,6 +1714,8 @@ msgstr "[path_to_binary]" #, fuzzy msgid "" "path_to_binary: path to WeeChat binary (default is current binary)\n" +" -dummy: do nothing (option used to prevent accidental completion " +"with \"-quit\")\n" " -quit: close *ALL* connections, save session and quit WeeChat, " "which makes possible a delayed restoration (see below)\n" "\n" diff --git a/po/it.po b/po/it.po index 03afa4fa4..e001e59c1 100644 --- a/po/it.po +++ b/po/it.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.4.2-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2013-07-02 15:35+0200\n" +"POT-Creation-Date: 2013-07-05 18:09+0200\n" "PO-Revision-Date: 2013-06-14 19:39-0300\n" "Last-Translator: Esteban I. Ruiz Moreno \n" "Language-Team: weechat-dev \n" @@ -2144,6 +2144,8 @@ msgstr "[|-quit]" #, fuzzy msgid "" "path_to_binary: path to WeeChat binary (default is current binary)\n" +" -dummy: do nothing (option used to prevent accidental completion " +"with \"-quit\")\n" " -quit: close *ALL* connections, save session and quit WeeChat, " "which makes possible a delayed restoration (see below)\n" "\n" diff --git a/po/ja.po b/po/ja.po index ba65cc471..435612748 100644 --- a/po/ja.po +++ b/po/ja.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.4.2-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2013-07-02 15:35+0200\n" +"POT-Creation-Date: 2013-07-05 18:09+0200\n" "PO-Revision-Date: 2013-07-02 16:02+0200\n" "Last-Translator: AYANOKOUZI, Ryuunosuke \n" "Language-Team: Japanese \n" @@ -2111,8 +2111,11 @@ msgstr "サーバとの接続を維持して WeeChat をアップグレード" msgid "[|-quit]" msgstr "[|-quit]" +#, fuzzy msgid "" "path_to_binary: path to WeeChat binary (default is current binary)\n" +" -dummy: do nothing (option used to prevent accidental completion " +"with \"-quit\")\n" " -quit: close *ALL* connections, save session and quit WeeChat, " "which makes possible a delayed restoration (see below)\n" "\n" diff --git a/po/pl.po b/po/pl.po index b09098f06..c4c388b02 100644 --- a/po/pl.po +++ b/po/pl.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.4.2-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2013-07-02 15:35+0200\n" +"POT-Creation-Date: 2013-07-05 18:09+0200\n" "PO-Revision-Date: 2013-07-02 15:37+0200\n" "Last-Translator: Krzysztof Korościk \n" "Language-Team: weechat-dev \n" @@ -2157,8 +2157,11 @@ msgstr "uaktualnia WeeChat bez rozłączania z serwerami" msgid "[|-quit]" msgstr "[<ścieżka_do_binarki>|-quit]" +#, fuzzy msgid "" "path_to_binary: path to WeeChat binary (default is current binary)\n" +" -dummy: do nothing (option used to prevent accidental completion " +"with \"-quit\")\n" " -quit: close *ALL* connections, save session and quit WeeChat, " "which makes possible a delayed restoration (see below)\n" "\n" diff --git a/po/pt_BR.po b/po/pt_BR.po index 92f7d20ef..d2ec4d0bf 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.4.2-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2013-07-02 15:35+0200\n" +"POT-Creation-Date: 2013-07-05 18:09+0200\n" "PO-Revision-Date: 2013-06-10 09:19+0200\n" "Last-Translator: Sergio Durigan Junior \n" "Language-Team: weechat-dev \n" @@ -2059,6 +2059,8 @@ msgstr "[]" #, fuzzy msgid "" "path_to_binary: path to WeeChat binary (default is current binary)\n" +" -dummy: do nothing (option used to prevent accidental completion " +"with \"-quit\")\n" " -quit: close *ALL* connections, save session and quit WeeChat, " "which makes possible a delayed restoration (see below)\n" "\n" diff --git a/po/ru.po b/po/ru.po index 4d582cb56..5f64ffee9 100644 --- a/po/ru.po +++ b/po/ru.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.4.2-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2013-07-02 15:35+0200\n" +"POT-Creation-Date: 2013-07-05 18:09+0200\n" "PO-Revision-Date: 2013-07-02 16:02+0200\n" "Last-Translator: Aleksey V Zapparov AKA ixti \n" "Language-Team: weechat-dev \n" @@ -1736,6 +1736,8 @@ msgstr "[путь_к_исполняемому_файлу]" #, fuzzy msgid "" "path_to_binary: path to WeeChat binary (default is current binary)\n" +" -dummy: do nothing (option used to prevent accidental completion " +"with \"-quit\")\n" " -quit: close *ALL* connections, save session and quit WeeChat, " "which makes possible a delayed restoration (see below)\n" "\n" diff --git a/po/tr.po b/po/tr.po index c700a9169..787523d4a 100644 --- a/po/tr.po +++ b/po/tr.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.4.2-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2013-07-02 15:35+0200\n" +"POT-Creation-Date: 2013-07-05 18:09+0200\n" "PO-Revision-Date: 2013-06-28 13:51+0200\n" "Last-Translator: Hasan Kiran \n" "Language-Team: weechat-dev \n" @@ -1537,6 +1537,8 @@ msgstr "" msgid "" "path_to_binary: path to WeeChat binary (default is current binary)\n" +" -dummy: do nothing (option used to prevent accidental completion " +"with \"-quit\")\n" " -quit: close *ALL* connections, save session and quit WeeChat, " "which makes possible a delayed restoration (see below)\n" "\n" diff --git a/po/weechat.pot b/po/weechat.pot index 1588e8c3d..647c9ca3e 100644 --- a/po/weechat.pot +++ b/po/weechat.pot @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.4.1-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2013-07-02 15:35+0200\n" +"POT-Creation-Date: 2013-07-05 18:09+0200\n" "PO-Revision-Date: 2013-02-14 18:20+0100\n" "Last-Translator: FULL NAME \n" "Language-Team: weechat-dev \n" @@ -1544,6 +1544,8 @@ msgstr "" msgid "" "path_to_binary: path to WeeChat binary (default is current binary)\n" +" -dummy: do nothing (option used to prevent accidental completion " +"with \"-quit\")\n" " -quit: close *ALL* connections, save session and quit WeeChat, " "which makes possible a delayed restoration (see below)\n" "\n" diff --git a/src/core/wee-command.c b/src/core/wee-command.c index d6f182f46..133646047 100644 --- a/src/core/wee-command.c +++ b/src/core/wee-command.c @@ -5014,6 +5014,9 @@ COMMAND_CALLBACK(upgrade) (void) data; (void) buffer; + if ((argc > 1) && (string_strcasecmp (argv[1], "-dummy") == 0)) + return WEECHAT_RC_OK; + /* * it is forbidden to upgrade while there are some background process * (hook type "process" or "connect") @@ -6624,6 +6627,8 @@ command_init () N_("[|-quit]"), N_("path_to_binary: path to WeeChat binary (default is " "current binary)\n" + " -dummy: do nothing (option used to prevent " + "accidental completion with \"-quit\")\n" " -quit: close *ALL* connections, save session " "and quit WeeChat, which makes possible a delayed " "restoration (see below)\n\n" @@ -6655,7 +6660,7 @@ command_init () "same configuration (files *.conf).\n" "It is possible to restore WeeChat session on another " "machine if you copy the content of directory \"~/.weechat\"."), - "%(filename)", + "%(filename)|-dummy|-quit", &command_upgrade, NULL); hook_command (NULL, "uptime", N_("show WeeChat uptime"),