From a02743b229ac5b9d7710590e1e3f57caf710652a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Tue, 14 Jul 2015 07:58:21 +0200 Subject: [PATCH] core: add option weechat.look.confirm_upgrade (closes #463) --- ChangeLog.asciidoc | 1 + doc/de/autogen/user/weechat_commands.asciidoc | 41 +++++++++-------- doc/de/autogen/user/weechat_options.asciidoc | 5 ++ doc/en/autogen/user/weechat_commands.asciidoc | 3 +- doc/en/autogen/user/weechat_options.asciidoc | 5 ++ doc/fr/autogen/user/weechat_commands.asciidoc | 3 +- doc/fr/autogen/user/weechat_options.asciidoc | 5 ++ doc/it/autogen/user/weechat_commands.asciidoc | 3 +- doc/it/autogen/user/weechat_options.asciidoc | 5 ++ doc/ja/autogen/user/weechat_commands.asciidoc | 41 +++++++++-------- doc/ja/autogen/user/weechat_options.asciidoc | 5 ++ doc/pl/autogen/user/weechat_commands.asciidoc | 41 +++++++++-------- doc/pl/autogen/user/weechat_options.asciidoc | 5 ++ po/cs.po | 17 +++++-- po/de.po | 19 ++++++-- po/es.po | 18 ++++++-- po/fr.po | 24 +++++++--- po/hu.po | 12 +++-- po/it.po | 18 ++++++-- po/ja.po | 19 ++++++-- po/pl.po | 19 ++++++-- po/pt_BR.po | 18 ++++++-- po/ru.po | 17 +++++-- po/tr.po | 12 +++-- po/weechat.pot | 12 +++-- src/core/wee-command.c | 46 +++++++++++++++---- src/core/wee-config.c | 7 +++ src/core/wee-config.h | 1 + 28 files changed, 301 insertions(+), 121 deletions(-) diff --git a/ChangeLog.asciidoc b/ChangeLog.asciidoc index b06d4ce76..25154109c 100644 --- a/ChangeLog.asciidoc +++ b/ChangeLog.asciidoc @@ -19,6 +19,7 @@ https://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes] === New features +* core: add option weechat.look.confirm_upgrade (closes #463) * core: allow ctrl-C to exit WeeChat when the passphrase is asked on startup (closes #452) * core: allow pointer as list name in evaluation of hdata (closes #450) diff --git a/doc/de/autogen/user/weechat_commands.asciidoc b/doc/de/autogen/user/weechat_commands.asciidoc index c0199e484..fae10d7f9 100644 --- a/doc/de/autogen/user/weechat_commands.asciidoc +++ b/doc/de/autogen/user/weechat_commands.asciidoc @@ -841,31 +841,32 @@ Beispiele: [command]*`upgrade`* Aktualisiert WeeChat ohne die Verbindung zum Server zu trennen:: ---- -/upgrade [|-quit] +/upgrade [-yes] [|-quit] -path_to_binary: Pfad zu einer ausführbaren WeeChat Binärdatei (Standardeinstellung ist die aktuell ausführbare Datei) - -dummy: ohne Funktion (dient lediglich dazu, um nicht versehentlich die "-quit" Funktion auszuführen) - -quit: trennt *ALLE* Verbindungen, speichert die aktuelle Sitzung und beendet WeeChat, um den aktuellen Zustand später wiederherstellen (siehe unten) + -yes: required if option weechat.look.confirm_upgrade is enabled +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 --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 --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/de/autogen/user/weechat_options.asciidoc b/doc/de/autogen/user/weechat_options.asciidoc index 6eb699390..9111168c4 100644 --- a/doc/de/autogen/user/weechat_options.asciidoc +++ b/doc/de/autogen/user/weechat_options.asciidoc @@ -542,6 +542,11 @@ ** Typ: boolesch ** Werte: on, off (Standardwert: `off`) +* [[option_weechat.look.confirm_upgrade]] *weechat.look.confirm_upgrade* +** Beschreibung: `if set, /upgrade command must be confirmed with extra argument "-yes" (see /help upgrade)` +** Typ: boolesch +** Werte: on, off (Standardwert: `off`) + * [[option_weechat.look.day_change]] *weechat.look.day_change* ** Beschreibung: `bei einem Datumswechsel wird eine entsprechende Nachricht angezeigt` ** Typ: boolesch diff --git a/doc/en/autogen/user/weechat_commands.asciidoc b/doc/en/autogen/user/weechat_commands.asciidoc index aea0caa96..90df54cf2 100644 --- a/doc/en/autogen/user/weechat_commands.asciidoc +++ b/doc/en/autogen/user/weechat_commands.asciidoc @@ -841,8 +841,9 @@ Examples: [command]*`upgrade`* upgrade WeeChat without disconnecting from servers:: ---- -/upgrade [|-quit] +/upgrade [-yes] [|-quit] + -yes: required if option weechat.look.confirm_upgrade is enabled 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) diff --git a/doc/en/autogen/user/weechat_options.asciidoc b/doc/en/autogen/user/weechat_options.asciidoc index ea2109bba..d889cd0cc 100644 --- a/doc/en/autogen/user/weechat_options.asciidoc +++ b/doc/en/autogen/user/weechat_options.asciidoc @@ -542,6 +542,11 @@ ** type: boolean ** values: on, off (default value: `off`) +* [[option_weechat.look.confirm_upgrade]] *weechat.look.confirm_upgrade* +** description: `if set, /upgrade command must be confirmed with extra argument "-yes" (see /help upgrade)` +** type: boolean +** values: on, off (default value: `off`) + * [[option_weechat.look.day_change]] *weechat.look.day_change* ** description: `display special message when day changes` ** type: boolean diff --git a/doc/fr/autogen/user/weechat_commands.asciidoc b/doc/fr/autogen/user/weechat_commands.asciidoc index c5aca48ca..65132837b 100644 --- a/doc/fr/autogen/user/weechat_commands.asciidoc +++ b/doc/fr/autogen/user/weechat_commands.asciidoc @@ -841,8 +841,9 @@ Exemples : [command]*`upgrade`* mettre à jour WeeChat sans se déconnecter des serveurs:: ---- -/upgrade [|-quit] +/upgrade [-yes] [|-quit] + -yes : requis si l'option weechat.look.confirm_upgrade est activée 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) diff --git a/doc/fr/autogen/user/weechat_options.asciidoc b/doc/fr/autogen/user/weechat_options.asciidoc index 061200382..f29fb039f 100644 --- a/doc/fr/autogen/user/weechat_options.asciidoc +++ b/doc/fr/autogen/user/weechat_options.asciidoc @@ -542,6 +542,11 @@ ** type: booléen ** valeurs: on, off (valeur par défaut: `off`) +* [[option_weechat.look.confirm_upgrade]] *weechat.look.confirm_upgrade* +** description: `si activé, la commande /upgrade doit être confirmée par le paramètre supplémentaire "-yes" (voir /help upgrade)` +** type: booléen +** valeurs: on, off (valeur par défaut: `off`) + * [[option_weechat.look.day_change]] *weechat.look.day_change* ** description: `affiche un message quand le jour change` ** type: booléen diff --git a/doc/it/autogen/user/weechat_commands.asciidoc b/doc/it/autogen/user/weechat_commands.asciidoc index f416f591e..7a91d9ad2 100644 --- a/doc/it/autogen/user/weechat_commands.asciidoc +++ b/doc/it/autogen/user/weechat_commands.asciidoc @@ -841,8 +841,9 @@ Examples: [command]*`upgrade`* aggiorna WeeChat senza disconnettere dai server:: ---- -/upgrade [|-quit] +/upgrade [-yes] [|-quit] + -yes: required if option weechat.look.confirm_upgrade is enabled 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) diff --git a/doc/it/autogen/user/weechat_options.asciidoc b/doc/it/autogen/user/weechat_options.asciidoc index 6044c876f..52d86902d 100644 --- a/doc/it/autogen/user/weechat_options.asciidoc +++ b/doc/it/autogen/user/weechat_options.asciidoc @@ -542,6 +542,11 @@ ** tipo: bool ** valori: on, off (valore predefinito: `off`) +* [[option_weechat.look.confirm_upgrade]] *weechat.look.confirm_upgrade* +** descrizione: `if set, /upgrade command must be confirmed with extra argument "-yes" (see /help upgrade)` +** tipo: bool +** valori: on, off (valore predefinito: `off`) + * [[option_weechat.look.day_change]] *weechat.look.day_change* ** descrizione: `mostra un messaggio speciale al cambio di data` ** tipo: bool diff --git a/doc/ja/autogen/user/weechat_commands.asciidoc b/doc/ja/autogen/user/weechat_commands.asciidoc index 1ceda7570..15cb4e350 100644 --- a/doc/ja/autogen/user/weechat_commands.asciidoc +++ b/doc/ja/autogen/user/weechat_commands.asciidoc @@ -841,31 +841,32 @@ option: オプションの名前 [command]*`upgrade`* サーバとの接続を維持して WeeChat をアップグレード:: ---- -/upgrade [|-quit] +/upgrade [-yes] [|-quit] -path_to_binary: WeeChat バイナリへのパス (デフォルトは現在のバイナリ) - -dummy: 何もしない (補完された "-quit" オプションを不用意に使わないためのオプション) - -quit: *すべての*接続を閉じ、セッションを保存して WeeChat を終了。遅延復帰 (詳しくは後述) が可能になります。 + -yes: required if option weechat.look.confirm_upgrade is enabled +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 --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 --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/ja/autogen/user/weechat_options.asciidoc b/doc/ja/autogen/user/weechat_options.asciidoc index 4e741f15b..bf592c19d 100644 --- a/doc/ja/autogen/user/weechat_options.asciidoc +++ b/doc/ja/autogen/user/weechat_options.asciidoc @@ -542,6 +542,11 @@ ** タイプ: ブール ** 値: on, off (デフォルト値: `off`) +* [[option_weechat.look.confirm_upgrade]] *weechat.look.confirm_upgrade* +** 説明: `if set, /upgrade command must be confirmed with extra argument "-yes" (see /help upgrade)` +** タイプ: ブール +** 値: on, off (デフォルト値: `off`) + * [[option_weechat.look.day_change]] *weechat.look.day_change* ** 説明: `日付が変わった際に特殊メッセージを表示` ** タイプ: ブール diff --git a/doc/pl/autogen/user/weechat_commands.asciidoc b/doc/pl/autogen/user/weechat_commands.asciidoc index 65ee1af9b..16de1562a 100644 --- a/doc/pl/autogen/user/weechat_commands.asciidoc +++ b/doc/pl/autogen/user/weechat_commands.asciidoc @@ -841,31 +841,32 @@ Przykłady: [command]*`upgrade`* uaktualnia WeeChat bez rozłączania z serwerami:: ---- -/upgrade [<ścieżka_do_binarki>|-quit] +/upgrade [-yes] [|-quit] -ścieżka_do_binarki: ścieżka do pliku binarnego WeeChat (domyślnie jest to obecny plik) - -dummy: nic nie rób (opcja użyta w celu zapobiegnięcia przypadkowego dopełnienia za pomocą"-quit") - -quit: zamyka *WSZYSTKIE* połączenia, zapisuje sesję i wyłącza WeeChat, umożliwia to późniejsze przywrócenie (zobacz niżej) + -yes: required if option weechat.look.confirm_upgrade is enabled +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) -Ta komenda ponownie uruchamia plik binarny WeeChat, zatem powinna zostać skompilowana lub zainstalowana za pomocą managera pakietów przed uruchomieniem tej komendy. +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. -Uwaga: połączenia SSL są przerywane podczas uaktualniania, ponieważ przeładowanie sesji SSL nie jest obecnie możliwe za pomocą GnuTLS. Po uaktualnieniu nastąpi ponowne ich połączenie. +Note: SSL connections are lost during upgrade, because reload of SSL sessions is currently not possible with GnuTLS. There is automatic reconnection after upgrade. -Proces uaktualnienia składa się z 4 kroków: - 1. zapisania sesji do plików dla rdzenia i wtyczek (bufory, historia, ..) - 2. wyładowanie wszystkich wtyczek (zapisanie plików konfiguracyjnych *.conf) - 3. zapisanie konfiguracji WeeChat (weechat.conf) - 4. uruchomienie nowego pliku binarnego WeeChat i przeładowanie sesji. +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. -Z opcją "-quit", proces przebiega inaczej: - 1. zamknięcie *WSZYSTKICH* połączeń (irc, xfer, relay, ...) - 2. zapisanie sesji do pliku (*.upgrade) - 3. wyładowanie wszystkich wtyczek - 4. zapisanie konfiguracji WeeChat - 5. wyłączenie WeeChat -Następnie można przywrócić sesję za pomocą komendy: weechat --upgrade -WAŻNE: należy przywracać sesję z identyczną konfiguracją (pliki *.conf). -Jest możliwe przywrócenie sesji WeeChat na innej maszynie, jeśli skopiujemy zawartość katalogu "~/.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 --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/pl/autogen/user/weechat_options.asciidoc b/doc/pl/autogen/user/weechat_options.asciidoc index 455844bf9..68a21d2af 100644 --- a/doc/pl/autogen/user/weechat_options.asciidoc +++ b/doc/pl/autogen/user/weechat_options.asciidoc @@ -542,6 +542,11 @@ ** typ: bool ** wartości: on, off (domyślna wartość: `off`) +* [[option_weechat.look.confirm_upgrade]] *weechat.look.confirm_upgrade* +** opis: `if set, /upgrade command must be confirmed with extra argument "-yes" (see /help upgrade)` +** typ: bool +** wartości: on, off (domyślna wartość: `off`) + * [[option_weechat.look.day_change]] *weechat.look.day_change* ** opis: `wyświetlaj specjalną wiadomość, kiedy zmienia się dzień` ** typ: bool diff --git a/po/cs.po b/po/cs.po index 27e192642..3087e0dba 100644 --- a/po/cs.po +++ b/po/cs.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2015-07-10 17:57+0200\n" +"POT-Creation-Date: 2015-07-14 07:44+0200\n" "PO-Revision-Date: 2015-07-11 21:42+0200\n" "Last-Translator: Jiri Golembiovsky \n" "Language-Team: weechat-dev \n" @@ -767,9 +767,9 @@ msgstr "Proxy byla smazána" msgid "%sError: unable to set option \"%s\" for proxy \"%s\"" msgstr "%sChyba: nemohu nastavit volbu \"%s\" pro proxy \"%s\"" -#, c-format +#, fuzzy, c-format msgid "" -"%sYou must confirm quit command with extra argument \"-yes\" (see /help quit)" +"%sYou must confirm /%s command with extra argument \"-yes\" (see /help %s)" msgstr "" "%sMusíte potvrdit příkaz quit speciálním argumentem \"-yes\" (viz /help quit)" @@ -2359,11 +2359,12 @@ msgid "upgrade WeeChat without disconnecting from servers" msgstr "aktualizovat WeeChat bez odpojení od serveru" #, fuzzy -msgid "[|-quit]" +msgid "[-yes] [|-quit]" msgstr "[]" #, fuzzy msgid "" +" -yes: required if option weechat.look.confirm_upgrade is enabled\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" @@ -2964,6 +2965,14 @@ msgstr "" "pokud je nastaveno musí být příkaz /quit potvrzen speciálním argumentem \"-" "yes\" (viz /help quit)" +#, fuzzy +msgid "" +"if set, /upgrade command must be confirmed with extra argument \"-yes" +"\" (see /help upgrade)" +msgstr "" +"pokud je nastaveno musí být příkaz /quit potvrzen speciálním argumentem \"-" +"yes\" (viz /help quit)" + msgid "display special message when day changes" msgstr "zobrazit speiální zprávy při změně dne" diff --git a/po/de.po b/po/de.po index e5c129f91..70bdbb67d 100644 --- a/po/de.po +++ b/po/de.po @@ -24,7 +24,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2015-07-10 17:57+0200\n" +"POT-Creation-Date: 2015-07-14 07:44+0200\n" "PO-Revision-Date: 2015-07-11 21:42+0200\n" "Last-Translator: Nils Görs \n" "Language-Team: German <>\n" @@ -807,9 +807,9 @@ msgid "%sError: unable to set option \"%s\" for proxy \"%s\"" msgstr "" "%sFehler: Einstellung \"%s\" kann für den Proxy \"%s\" nicht gesetzt werden" -#, c-format +#, fuzzy, c-format msgid "" -"%sYou must confirm quit command with extra argument \"-yes\" (see /help quit)" +"%sYou must confirm /%s command with extra argument \"-yes\" (see /help %s)" msgstr "" "%sUm WeeChat zu beenden, muss der \"/quit\" Befehl mit dem Argument \"-yes\" " "ausgeführt werden (siehe /help quit)" @@ -2784,10 +2784,13 @@ msgstr "" msgid "upgrade WeeChat without disconnecting from servers" msgstr "Aktualisiert WeeChat ohne die Verbindung zum Server zu trennen" -msgid "[|-quit]" +#, fuzzy +msgid "[-yes] [|-quit]" msgstr "[|-quit]" +#, fuzzy msgid "" +" -yes: required if option weechat.look.confirm_upgrade is enabled\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" @@ -3508,6 +3511,14 @@ msgstr "" "ist diese Einstellung aktiviert, muss der \"/quit\" Befehl mit dem Argument " "\"-yes\" ausgeführt werden (siehe /help quit)" +#, fuzzy +msgid "" +"if set, /upgrade command must be confirmed with extra argument \"-yes" +"\" (see /help upgrade)" +msgstr "" +"ist diese Einstellung aktiviert, muss der \"/quit\" Befehl mit dem Argument " +"\"-yes\" ausgeführt werden (siehe /help quit)" + msgid "display special message when day changes" msgstr "bei einem Datumswechsel wird eine entsprechende Nachricht angezeigt" diff --git a/po/es.po b/po/es.po index 479a82eb7..45e96c718 100644 --- a/po/es.po +++ b/po/es.po @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2015-07-10 17:57+0200\n" +"POT-Creation-Date: 2015-07-14 07:44+0200\n" "PO-Revision-Date: 2015-07-11 21:42+0200\n" "Last-Translator: Elián Hanisch \n" "Language-Team: weechat-dev \n" @@ -771,9 +771,9 @@ msgstr "Proxy eliminado" msgid "%sError: unable to set option \"%s\" for proxy \"%s\"" msgstr "%sError: no se pudo configurar la opción \"%s\" para el proxy \"%s\"" -#, c-format +#, fuzzy, c-format msgid "" -"%sYou must confirm quit command with extra argument \"-yes\" (see /help quit)" +"%sYou must confirm /%s command with extra argument \"-yes\" (see /help %s)" msgstr "" "%sDebes confirmar el comando de salida con el argumento extra \"-yes\" (ver /" "help quit)" @@ -2476,11 +2476,13 @@ msgstr "" msgid "upgrade WeeChat without disconnecting from servers" msgstr "actualizar WeeChat sin desconectarse de los servidores" -msgid "[|-quit]" +#, fuzzy +msgid "[-yes] [|-quit]" msgstr "[|-quit]" #, fuzzy msgid "" +" -yes: required if option weechat.look.confirm_upgrade is enabled\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" @@ -3120,6 +3122,14 @@ msgstr "" "si es verdadero, el comando /quit debe ser confirmado con un argumento extra " "\"-yes\" (ver /help quit)" +#, fuzzy +msgid "" +"if set, /upgrade command must be confirmed with extra argument \"-yes" +"\" (see /help upgrade)" +msgstr "" +"si es verdadero, el comando /quit debe ser confirmado con un argumento extra " +"\"-yes\" (ver /help quit)" + msgid "display special message when day changes" msgstr "mostrar un mensaje especial cuando el día cambia" diff --git a/po/fr.po b/po/fr.po index 94082e65c..3e6347302 100644 --- a/po/fr.po +++ b/po/fr.po @@ -21,8 +21,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2015-07-10 17:57+0200\n" -"PO-Revision-Date: 2015-07-11 21:42+0200\n" +"POT-Creation-Date: 2015-07-14 07:44+0200\n" +"PO-Revision-Date: 2015-07-14 07:46+0200\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" "Language: fr\n" @@ -790,10 +790,10 @@ msgstr "%sErreur : impossible de modifier l'option \"%s\" pour le proxy \"%s\"" #, c-format msgid "" -"%sYou must confirm quit command with extra argument \"-yes\" (see /help quit)" +"%sYou must confirm /%s command with extra argument \"-yes\" (see /help %s)" msgstr "" -"%sVous devez confirmer la commande pour quitter avec le paramètre " -"supplémentaire \"-yes\" (voir /help quit)" +"%sVous devez confirmer la commande /%s avec le paramètre supplémentaire \"-" +"yes\" (voir /help %s)" #, c-format msgid "Options reloaded from %s" @@ -2718,10 +2718,11 @@ msgstr "" msgid "upgrade WeeChat without disconnecting from servers" msgstr "mettre à jour WeeChat sans se déconnecter des serveurs" -msgid "[|-quit]" -msgstr "[|-quit]" +msgid "[-yes] [|-quit]" +msgstr "[-yes] [|-quit]" msgid "" +" -yes: required if option weechat.look.confirm_upgrade is enabled\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" @@ -2754,6 +2755,8 @@ msgid "" "It is possible to restore WeeChat session on another machine if you copy the " "content of directory \"~/.weechat\"." msgstr "" +" -yes : requis si l'option weechat.look.confirm_upgrade est " +"activée\n" "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 " @@ -3417,6 +3420,13 @@ msgstr "" "si activé, la commande /quit doit être confirmée par le paramètre " "supplémentaire \"-yes\" (voir /help quit)" +msgid "" +"if set, /upgrade command must be confirmed with extra argument \"-yes" +"\" (see /help upgrade)" +msgstr "" +"si activé, la commande /upgrade doit être confirmée par le paramètre " +"supplémentaire \"-yes\" (voir /help upgrade)" + msgid "display special message when day changes" msgstr "affiche un message quand le jour change" diff --git a/po/hu.po b/po/hu.po index 9222a6a11..aad4fe069 100644 --- a/po/hu.po +++ b/po/hu.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2015-07-10 17:57+0200\n" +"POT-Creation-Date: 2015-07-14 07:44+0200\n" "PO-Revision-Date: 2015-07-11 21:42+0200\n" "Last-Translator: Andras Voroskoi \n" "Language-Team: weechat-dev \n" @@ -806,7 +806,7 @@ msgstr "%s ismeretlen opció a \"%s\" parancsnak\n" #, c-format msgid "" -"%sYou must confirm quit command with extra argument \"-yes\" (see /help quit)" +"%sYou must confirm /%s command with extra argument \"-yes\" (see /help %s)" msgstr "" #, fuzzy, c-format @@ -2073,11 +2073,12 @@ msgid "upgrade WeeChat without disconnecting from servers" msgstr "WeeChat frissítése a szerverekről való lecsatlakozás nélkül" #, fuzzy -msgid "[|-quit]" +msgid "[-yes] [|-quit]" msgstr "[path_to_binary]" #, fuzzy msgid "" +" -yes: required if option weechat.look.confirm_upgrade is enabled\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" @@ -2607,6 +2608,11 @@ msgid "" "help quit)" msgstr "" +msgid "" +"if set, /upgrade command must be confirmed with extra argument \"-yes" +"\" (see /help upgrade)" +msgstr "" + msgid "display special message when day changes" msgstr "speciális üzenet az aktuális nap megváltozásakor" diff --git a/po/it.po b/po/it.po index 5f2b0e583..44791677b 100644 --- a/po/it.po +++ b/po/it.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2015-07-10 17:57+0200\n" +"POT-Creation-Date: 2015-07-14 07:44+0200\n" "PO-Revision-Date: 2015-07-11 21:42+0200\n" "Last-Translator: Esteban I. Ruiz Moreno \n" "Language-Team: weechat-dev \n" @@ -759,9 +759,9 @@ msgstr "Proxy eliminato" msgid "%sError: unable to set option \"%s\" for proxy \"%s\"" msgstr "%sErrore: impossibile impostare l'opzione \"%s\" per il proxy \"%s\"" -#, c-format +#, fuzzy, c-format msgid "" -"%sYou must confirm quit command with extra argument \"-yes\" (see /help quit)" +"%sYou must confirm /%s command with extra argument \"-yes\" (see /help %s)" msgstr "" "%sBisogna confermare il comando quit con l'argomento extra \"-yes\" " "consultare /help quit)" @@ -2564,11 +2564,13 @@ msgstr "" msgid "upgrade WeeChat without disconnecting from servers" msgstr "aggiorna WeeChat senza disconnettere dai server" -msgid "[|-quit]" +#, fuzzy +msgid "[-yes] [|-quit]" msgstr "[|-quit]" #, fuzzy msgid "" +" -yes: required if option weechat.look.confirm_upgrade is enabled\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" @@ -3217,6 +3219,14 @@ msgstr "" "se impostata, il comando /quit deve essere confermato con l'argomento extra " "\"-yes\" (consultare /help quit)" +#, fuzzy +msgid "" +"if set, /upgrade command must be confirmed with extra argument \"-yes" +"\" (see /help upgrade)" +msgstr "" +"se impostata, il comando /quit deve essere confermato con l'argomento extra " +"\"-yes\" (consultare /help quit)" + msgid "display special message when day changes" msgstr "mostra un messaggio speciale al cambio di data" diff --git a/po/ja.po b/po/ja.po index 48ddae9f3..72db52949 100644 --- a/po/ja.po +++ b/po/ja.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2015-07-10 17:57+0200\n" +"POT-Creation-Date: 2015-07-14 07:44+0200\n" "PO-Revision-Date: 2015-07-13 22:27+0900\n" "Last-Translator: AYANOKOUZI, Ryuunosuke \n" "Language-Team: Japanese \n" @@ -780,9 +780,9 @@ msgid "%sError: unable to set option \"%s\" for proxy \"%s\"" msgstr "" "%1$sエラー: プロキシ \"%3$s\" に対するオプション \"%2$s\" を設定できません" -#, c-format +#, fuzzy, c-format msgid "" -"%sYou must confirm quit command with extra argument \"-yes\" (see /help quit)" +"%sYou must confirm /%s command with extra argument \"-yes\" (see /help %s)" msgstr "" "%s引数 \"-yes\" を追加しないと quit コマンドの確認が出来なくなります (/help " "quit を読んでください)" @@ -2644,10 +2644,13 @@ msgstr "" msgid "upgrade WeeChat without disconnecting from servers" msgstr "サーバとの接続を維持して WeeChat をアップグレード" -msgid "[|-quit]" +#, fuzzy +msgid "[-yes] [|-quit]" msgstr "[|-quit]" +#, fuzzy msgid "" +" -yes: required if option weechat.look.confirm_upgrade is enabled\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" @@ -3317,6 +3320,14 @@ msgstr "" "セットされた場合、/quit コマンドは \"-yes\" 引数と共に使われなければいけない " "(help quit を参照)" +#, fuzzy +msgid "" +"if set, /upgrade command must be confirmed with extra argument \"-yes" +"\" (see /help upgrade)" +msgstr "" +"セットされた場合、/quit コマンドは \"-yes\" 引数と共に使われなければいけない " +"(help quit を参照)" + msgid "display special message when day changes" msgstr "日付が変わった際に特殊メッセージを表示" diff --git a/po/pl.po b/po/pl.po index 074a77c03..701bae39f 100644 --- a/po/pl.po +++ b/po/pl.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2015-07-10 17:57+0200\n" +"POT-Creation-Date: 2015-07-14 07:44+0200\n" "PO-Revision-Date: 2015-07-11 21:42+0200\n" "Last-Translator: Krzysztof Korościk \n" "Language-Team: weechat-dev \n" @@ -788,9 +788,9 @@ msgstr "Proxy usunięte" msgid "%sError: unable to set option \"%s\" for proxy \"%s\"" msgstr "%sBłąd: nie można ustawić opcji \"%s\" dla proxy \"%s\"" -#, c-format +#, fuzzy, c-format msgid "" -"%sYou must confirm quit command with extra argument \"-yes\" (see /help quit)" +"%sYou must confirm /%s command with extra argument \"-yes\" (see /help %s)" msgstr "" "%sMusisz potwierdzić użycie komendy quit dodatkowym argumentem \"-yes" "\" (zobacz /help quit)" @@ -2693,10 +2693,13 @@ msgstr "" msgid "upgrade WeeChat without disconnecting from servers" msgstr "uaktualnia WeeChat bez rozłączania z serwerami" -msgid "[|-quit]" +#, fuzzy +msgid "[-yes] [|-quit]" msgstr "[<ścieżka_do_binarki>|-quit]" +#, fuzzy msgid "" +" -yes: required if option weechat.look.confirm_upgrade is enabled\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" @@ -3374,6 +3377,14 @@ msgstr "" "jeśli ustawione, komenda /quit musi być potwierdzona dodatkowym argumentem " "\"-yes\" (zobacz /help quit)" +#, fuzzy +msgid "" +"if set, /upgrade command must be confirmed with extra argument \"-yes" +"\" (see /help upgrade)" +msgstr "" +"jeśli ustawione, komenda /quit musi być potwierdzona dodatkowym argumentem " +"\"-yes\" (zobacz /help quit)" + msgid "display special message when day changes" msgstr "wyświetlaj specjalną wiadomość, kiedy zmienia się dzień" diff --git a/po/pt_BR.po b/po/pt_BR.po index 2fb7a5b71..2e17f1615 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2015-07-10 17:57+0200\n" +"POT-Creation-Date: 2015-07-14 07:44+0200\n" "PO-Revision-Date: 2015-07-11 21:42+0200\n" "Last-Translator: Eduardo Elias \n" "Language-Team: weechat-dev \n" @@ -795,9 +795,9 @@ msgstr "Proxy excluído" msgid "%sError: unable to set option \"%s\" for proxy \"%s\"" msgstr "%sErro : incapaz de configurar a opção \"%s\" para o proxy \"%s\"" -#, c-format +#, fuzzy, c-format msgid "" -"%sYou must confirm quit command with extra argument \"-yes\" (see /help quit)" +"%sYou must confirm /%s command with extra argument \"-yes\" (see /help %s)" msgstr "" "%sVocê precisa confirmar o comando quit com um argumento extra \"-yes" "\" (veja /help quit)" @@ -2507,11 +2507,13 @@ msgstr "" msgid "upgrade WeeChat without disconnecting from servers" msgstr "atualiza o WeeChat sem desconectar dos servidores" -msgid "[|-quit]" +#, fuzzy +msgid "[-yes] [|-quit]" msgstr "[|-quit]" #, fuzzy msgid "" +" -yes: required if option weechat.look.confirm_upgrade is enabled\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" @@ -3151,6 +3153,14 @@ msgstr "" "se utilizado, o comando /quit pode ser confirmado com um argumento extra \"-" "yes\" (veja /help quit)" +#, fuzzy +msgid "" +"if set, /upgrade command must be confirmed with extra argument \"-yes" +"\" (see /help upgrade)" +msgstr "" +"se utilizado, o comando /quit pode ser confirmado com um argumento extra \"-" +"yes\" (veja /help quit)" + msgid "display special message when day changes" msgstr "mostra uma mensagem especial quando o dia muda" diff --git a/po/ru.po b/po/ru.po index c8dc262c5..e34bd1fdf 100644 --- a/po/ru.po +++ b/po/ru.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2015-07-10 17:57+0200\n" +"POT-Creation-Date: 2015-07-14 07:44+0200\n" "PO-Revision-Date: 2015-07-11 21:42+0200\n" "Last-Translator: Aleksey V Zapparov AKA ixti \n" "Language-Team: weechat-dev \n" @@ -817,9 +817,9 @@ msgstr "команда users отключена" msgid "%sError: unable to set option \"%s\" for proxy \"%s\"" msgstr "%s неизвестный параметр для команды \"%s\"\n" -#, c-format +#, fuzzy, c-format msgid "" -"%sYou must confirm quit command with extra argument \"-yes\" (see /help quit)" +"%sYou must confirm /%s command with extra argument \"-yes\" (see /help %s)" msgstr "" "%sНеобходимо подтвердить команду выхода дополнительным аргументом \"-yes" "\" (см. /help quit)" @@ -2096,11 +2096,12 @@ msgid "upgrade WeeChat without disconnecting from servers" msgstr "обновить WeeChat не отключаясь от серверов" #, fuzzy -msgid "[|-quit]" +msgid "[-yes] [|-quit]" msgstr "[путь_к_исполняемому_файлу]" #, fuzzy msgid "" +" -yes: required if option weechat.look.confirm_upgrade is enabled\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" @@ -2630,6 +2631,14 @@ msgid "" "help quit)" msgstr "" +#, fuzzy +msgid "" +"if set, /upgrade command must be confirmed with extra argument \"-yes" +"\" (see /help upgrade)" +msgstr "" +"%sНеобходимо подтвердить команду выхода дополнительным аргументом \"-yes" +"\" (см. /help quit)" + msgid "display special message when day changes" msgstr "отображать специальное сообщение при смене дня" diff --git a/po/tr.po b/po/tr.po index 6780555da..0b4dfd75c 100644 --- a/po/tr.po +++ b/po/tr.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2015-07-10 17:57+0200\n" +"POT-Creation-Date: 2015-07-14 07:44+0200\n" "PO-Revision-Date: 2015-03-10 21:33+0100\n" "Last-Translator: Hasan Kiran \n" "Language-Team: weechat-dev \n" @@ -724,7 +724,7 @@ msgstr "" #, c-format msgid "" -"%sYou must confirm quit command with extra argument \"-yes\" (see /help quit)" +"%sYou must confirm /%s command with extra argument \"-yes\" (see /help %s)" msgstr "" #, c-format @@ -1890,10 +1890,11 @@ msgstr "" msgid "upgrade WeeChat without disconnecting from servers" msgstr "" -msgid "[|-quit]" +msgid "[-yes] [|-quit]" msgstr "" msgid "" +" -yes: required if option weechat.look.confirm_upgrade is enabled\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" @@ -2360,6 +2361,11 @@ msgid "" "help quit)" msgstr "" +msgid "" +"if set, /upgrade command must be confirmed with extra argument \"-yes" +"\" (see /help upgrade)" +msgstr "" + msgid "display special message when day changes" msgstr "" diff --git a/po/weechat.pot b/po/weechat.pot index 3be536fc5..c78265181 100644 --- a/po/weechat.pot +++ b/po/weechat.pot @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2015-07-10 17:57+0200\n" +"POT-Creation-Date: 2015-07-14 07:44+0200\n" "PO-Revision-Date: 2014-08-16 10:27+0200\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" @@ -724,7 +724,7 @@ msgstr "" #, c-format msgid "" -"%sYou must confirm quit command with extra argument \"-yes\" (see /help quit)" +"%sYou must confirm /%s command with extra argument \"-yes\" (see /help %s)" msgstr "" #, c-format @@ -1888,10 +1888,11 @@ msgstr "" msgid "upgrade WeeChat without disconnecting from servers" msgstr "" -msgid "[|-quit]" +msgid "[-yes] [|-quit]" msgstr "" msgid "" +" -yes: required if option weechat.look.confirm_upgrade is enabled\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" @@ -2357,6 +2358,11 @@ msgid "" "help quit)" msgstr "" +msgid "" +"if set, /upgrade command must be confirmed with extra argument \"-yes" +"\" (see /help upgrade)" +msgstr "" + msgid "display special message when day changes" msgstr "" diff --git a/src/core/wee-command.c b/src/core/wee-command.c index aece0e78a..e37ebc35c 100644 --- a/src/core/wee-command.c +++ b/src/core/wee-command.c @@ -4861,9 +4861,10 @@ COMMAND_CALLBACK(quit) if (CONFIG_BOOLEAN(config_look_confirm_quit) && !confirm_ok) { gui_chat_printf (NULL, - _("%sYou must confirm quit command with extra " - "argument \"-yes\" (see /help quit)"), - gui_chat_prefix[GUI_CHAT_PREFIX_ERROR]); + _("%sYou must confirm /%s command with extra " + "argument \"-yes\" (see /help %s)"), + gui_chat_prefix[GUI_CHAT_PREFIX_ERROR], + "quit", "quit"); return WEECHAT_RC_OK; } @@ -6013,14 +6014,37 @@ COMMAND_CALLBACK(upgrade) char *ptr_binary; char *exec_args[7] = { NULL, "-a", "--dir", NULL, "--upgrade", NULL }; struct stat stat_buf; - int rc, quit; + int confirm_ok, index_args, rc, quit; /* make C compiler happy */ (void) data; (void) buffer; - if ((argc > 1) && (string_strcasecmp (argv[1], "-dummy") == 0)) + confirm_ok = 0; + index_args = 1; + + if ((argc > 1) && (string_strcasecmp (argv[1], "-yes") == 0)) + { + confirm_ok = 1; + index_args = 2; + } + + /* if confirmation is required, check that "-yes" is given */ + if (CONFIG_BOOLEAN(config_look_confirm_upgrade) && !confirm_ok) + { + gui_chat_printf (NULL, + _("%sYou must confirm /%s command with extra " + "argument \"-yes\" (see /help %s)"), + gui_chat_prefix[GUI_CHAT_PREFIX_ERROR], + "upgrade", "upgrade"); return WEECHAT_RC_OK; + } + + if ((argc > index_args) + && (string_strcasecmp (argv[index_args], "-dummy") == 0)) + { + return WEECHAT_RC_OK; + } /* * it is forbidden to upgrade while there are some background process @@ -6038,13 +6062,13 @@ COMMAND_CALLBACK(upgrade) ptr_binary = NULL; quit = 0; - if (argc > 1) + if (argc > index_args) { - if (string_strcasecmp (argv[1], "-quit") == 0) + if (string_strcasecmp (argv[index_args], "-quit") == 0) quit = 1; else { - ptr_binary = string_expand_home (argv_eol[1]); + ptr_binary = string_expand_home (argv_eol[index_args]); if (ptr_binary) { /* check if weechat binary is here and executable by user */ @@ -7853,8 +7877,10 @@ command_init () hook_command ( NULL, "upgrade", N_("upgrade WeeChat without disconnecting from servers"), - N_("[|-quit]"), - N_("path_to_binary: path to WeeChat binary (default is current binary)\n" + N_("[-yes] [|-quit]"), + N_(" -yes: required if option weechat.look.confirm_upgrade " + "is enabled\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 " diff --git a/src/core/wee-config.c b/src/core/wee-config.c index 350b43656..36b781de4 100644 --- a/src/core/wee-config.c +++ b/src/core/wee-config.c @@ -107,6 +107,7 @@ struct t_config_option *config_look_color_real_white; struct t_config_option *config_look_command_chars; struct t_config_option *config_look_command_incomplete; struct t_config_option *config_look_confirm_quit; +struct t_config_option *config_look_confirm_upgrade; struct t_config_option *config_look_day_change; struct t_config_option *config_look_day_change_message_1date; struct t_config_option *config_look_day_change_message_2dates; @@ -2380,6 +2381,12 @@ config_weechat_init_options () N_("if set, /quit command must be confirmed with extra argument " "\"-yes\" (see /help quit)"), NULL, 0, 0, "off", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + config_look_confirm_upgrade = config_file_new_option ( + weechat_config_file, ptr_section, + "confirm_upgrade", "boolean", + N_("if set, /upgrade command must be confirmed with extra argument " + "\"-yes\" (see /help upgrade)"), + NULL, 0, 0, "off", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); config_look_day_change = config_file_new_option ( weechat_config_file, ptr_section, "day_change", "boolean", diff --git a/src/core/wee-config.h b/src/core/wee-config.h index d851f3476..7a8651281 100644 --- a/src/core/wee-config.h +++ b/src/core/wee-config.h @@ -154,6 +154,7 @@ extern struct t_config_option *config_look_color_real_white; extern struct t_config_option *config_look_command_chars; extern struct t_config_option *config_look_command_incomplete; extern struct t_config_option *config_look_confirm_quit; +extern struct t_config_option *config_look_confirm_upgrade; extern struct t_config_option *config_look_day_change; extern struct t_config_option *config_look_day_change_message_1date; extern struct t_config_option *config_look_day_change_message_2dates;