summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2024-03-25 21:00:42 +0100
committerSébastien Helleu <flashcode@flashtux.org>2024-03-25 21:00:42 +0100
commit26630ada2dc7ec9839f5bcf4d4b99ff0dcb6ca69 (patch)
tree02d583621f48887352fd8c4d6ae243accedd3e1e
parent8482e1463001dd28505c9b7ef68aefeccf916c80 (diff)
downloadweechat-26630ada2dc7ec9839f5bcf4d4b99ff0dcb6ca69.zip
fset: add option `-import` in command `/fset`
-rw-r--r--ChangeLog.adoc1
-rw-r--r--po/cs.po9
-rw-r--r--po/de.po15
-rw-r--r--po/es.po9
-rw-r--r--po/fr.po15
-rw-r--r--po/hu.po9
-rw-r--r--po/it.po9
-rw-r--r--po/ja.po15
-rw-r--r--po/pl.po15
-rw-r--r--po/pt.po9
-rw-r--r--po/pt_BR.po9
-rw-r--r--po/ru.po9
-rw-r--r--po/sr.po15
-rw-r--r--po/tr.po15
-rw-r--r--po/weechat.pot9
-rw-r--r--src/plugins/fset/fset-command.c13
-rw-r--r--src/plugins/fset/fset-option.c57
-rw-r--r--src/plugins/fset/fset-option.h1
18 files changed, 204 insertions, 30 deletions
diff --git a/ChangeLog.adoc b/ChangeLog.adoc
index f32816365..3cb6a8c18 100644
--- a/ChangeLog.adoc
+++ b/ChangeLog.adoc
@@ -36,6 +36,7 @@ New features::
* api: add info "plugin_loaded"
* api: add support of specifier `%!` for timestamp in function util_strftimeval
* api: add support of base64url in encode/decode functions
+ * fset: add option `-import` in command `/fset`
* irc: add option `-all` in command `/allchan`, do not execute command on parted channels by default (issue #2085)
* irc: add server option "autojoin_delay" (delay before autojoin), use option "command_delay" before execution of the command (issue #862)
* relay: add "api" protocol (HTTP REST API), add option relay.look.display_clients, change option type relay.look.auto_open_buffer to string, rename option relay.weechat.commands to relay.network.commands, add option relay.network.time_window (issue #2066)
diff --git a/po/cs.po b/po/cs.po
index cab22c2aa..c70432d34 100644
--- a/po/cs.po
+++ b/po/cs.po
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2024-03-25 12:05+0100\n"
+"POT-Creation-Date: 2024-03-25 20:59+0100\n"
"PO-Revision-Date: 2024-03-06 20:32+0100\n"
"Last-Translator: Ondřej Súkup <mimi.vx@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -7403,7 +7403,7 @@ msgid ""
"-bar || -refresh || -up|-down [<number>] || -left|-right [<percent>] || -go "
"<line>|end || -toggle || -add [<value>] || -reset || -unset || -set || -"
"setnew || -append || -mark || -format || -export [-help|-nohelp] <filename> "
-"|| <filter>"
+"|| -import <filename> || <filter>"
msgstr ""
msgid "raw[-bar]: add the help bar"
@@ -7473,6 +7473,11 @@ msgid ""
msgstr ""
msgid ""
+"raw[-import]: import the options from a file (all lines containing commands "
+"are are executed)"
+msgstr ""
+
+msgid ""
"raw[-help]: force writing of help on options in exported file (see /help "
"fset.look.export_help_default)"
msgstr ""
diff --git a/po/de.po b/po/de.po
index 933860289..56319bffd 100644
--- a/po/de.po
+++ b/po/de.po
@@ -26,7 +26,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2024-03-25 12:05+0100\n"
+"POT-Creation-Date: 2024-03-25 20:59+0100\n"
"PO-Revision-Date: 2024-03-25 11:43+0100\n"
"Last-Translator: Nils Görs <weechatter@arcor.de>\n"
"Language-Team: German <kde-i18n-de@kde.org>\n"
@@ -8497,11 +8497,17 @@ msgid "fast set WeeChat and plugins options"
msgstr "Optionen von WeeChat und Erweiterungen schnell anpassen"
#. TRANSLATORS: only text between angle brackets (eg: "<name>") must be translated
+#, fuzzy
+#| msgid ""
+#| "-bar || -refresh || -up|-down [<number>] || -left|-right [<percent>] || -"
+#| "go <line>|end || -toggle || -add [<value>] || -reset || -unset || -set || "
+#| "-setnew || -append || -mark || -format || -export [-help|-nohelp] "
+#| "<filename> || <filter>"
msgid ""
"-bar || -refresh || -up|-down [<number>] || -left|-right [<percent>] || -go "
"<line>|end || -toggle || -add [<value>] || -reset || -unset || -set || -"
"setnew || -append || -mark || -format || -export [-help|-nohelp] <filename> "
-"|| <filter>"
+"|| -import <filename> || <filter>"
msgstr ""
"-bar || -refresh || -up|-down [<number>] || -left|-right [<percent>] || -go "
"<line>|end || -toggle || -add [<value>] || -reset || -unset || -set || -"
@@ -8600,6 +8606,11 @@ msgstr ""
"Name\")"
msgid ""
+"raw[-import]: import the options from a file (all lines containing commands "
+"are are executed)"
+msgstr ""
+
+msgid ""
"raw[-help]: force writing of help on options in exported file (see /help "
"fset.look.export_help_default)"
msgstr ""
diff --git a/po/es.po b/po/es.po
index 968de3e23..b1585f40e 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: 2024-03-25 12:05+0100\n"
+"POT-Creation-Date: 2024-03-25 20:59+0100\n"
"PO-Revision-Date: 2024-03-06 20:32+0100\n"
"Last-Translator: Santiago Forero <santiago@forero.xyz>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -7584,7 +7584,7 @@ msgid ""
"-bar || -refresh || -up|-down [<number>] || -left|-right [<percent>] || -go "
"<line>|end || -toggle || -add [<value>] || -reset || -unset || -set || -"
"setnew || -append || -mark || -format || -export [-help|-nohelp] <filename> "
-"|| <filter>"
+"|| -import <filename> || <filter>"
msgstr ""
msgid "raw[-bar]: add the help bar"
@@ -7654,6 +7654,11 @@ msgid ""
msgstr ""
msgid ""
+"raw[-import]: import the options from a file (all lines containing commands "
+"are are executed)"
+msgstr ""
+
+msgid ""
"raw[-help]: force writing of help on options in exported file (see /help "
"fset.look.export_help_default)"
msgstr ""
diff --git a/po/fr.po b/po/fr.po
index 4f9419a3b..858551cb5 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: 2024-03-25 12:05+0100\n"
-"PO-Revision-Date: 2024-03-25 12:06+0100\n"
+"POT-Creation-Date: 2024-03-25 20:59+0100\n"
+"PO-Revision-Date: 2024-03-25 21:00+0100\n"
"Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: fr\n"
@@ -8336,12 +8336,12 @@ msgid ""
"-bar || -refresh || -up|-down [<number>] || -left|-right [<percent>] || -go "
"<line>|end || -toggle || -add [<value>] || -reset || -unset || -set || -"
"setnew || -append || -mark || -format || -export [-help|-nohelp] <filename> "
-"|| <filter>"
+"|| -import <filename> || <filter>"
msgstr ""
"-bar || -refresh || -up|-down [<nombre>] || -left|-right [<pourcentage>] || -"
"go <ligne>|end || -toggle || -add [<valeur>] || -reset || -unset || -set || -"
"setnew || -append || -mark || -format || -export [-help|-nohelp] <fichier> "
-"|| <filtre>"
+"|| -import <fichier> || <filtre>"
msgid "raw[-bar]: add the help bar"
msgstr "raw[-bar] : ajouter la barre d'aide"
@@ -8433,6 +8433,13 @@ msgstr ""
"(chaque ligne a le format : \"/set nom valeur\" ou \"/unset nom\")"
msgid ""
+"raw[-import]: import the options from a file (all lines containing commands "
+"are are executed)"
+msgstr ""
+"raw[-import] : importer les options depuis un fichier (toutes les lignes qui "
+"contiennent des commandes sont exécutées)"
+
+msgid ""
"raw[-help]: force writing of help on options in exported file (see /help "
"fset.look.export_help_default)"
msgstr ""
diff --git a/po/hu.po b/po/hu.po
index 0ed0dfa04..ed10a786f 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: 2024-03-25 12:05+0100\n"
+"POT-Creation-Date: 2024-03-25 20:59+0100\n"
"PO-Revision-Date: 2023-11-29 09:59+0100\n"
"Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -7068,7 +7068,7 @@ msgid ""
"-bar || -refresh || -up|-down [<number>] || -left|-right [<percent>] || -go "
"<line>|end || -toggle || -add [<value>] || -reset || -unset || -set || -"
"setnew || -append || -mark || -format || -export [-help|-nohelp] <filename> "
-"|| <filter>"
+"|| -import <filename> || <filter>"
msgstr ""
msgid "raw[-bar]: add the help bar"
@@ -7138,6 +7138,11 @@ msgid ""
msgstr ""
msgid ""
+"raw[-import]: import the options from a file (all lines containing commands "
+"are are executed)"
+msgstr ""
+
+msgid ""
"raw[-help]: force writing of help on options in exported file (see /help "
"fset.look.export_help_default)"
msgstr ""
diff --git a/po/it.po b/po/it.po
index 0df63c505..04805bc5a 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: 2024-03-25 12:05+0100\n"
+"POT-Creation-Date: 2024-03-25 20:59+0100\n"
"PO-Revision-Date: 2024-03-06 20:32+0100\n"
"Last-Translator: Esteban I. Ruiz Moreno <exio4.com@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -7576,7 +7576,7 @@ msgid ""
"-bar || -refresh || -up|-down [<number>] || -left|-right [<percent>] || -go "
"<line>|end || -toggle || -add [<value>] || -reset || -unset || -set || -"
"setnew || -append || -mark || -format || -export [-help|-nohelp] <filename> "
-"|| <filter>"
+"|| -import <filename> || <filter>"
msgstr ""
msgid "raw[-bar]: add the help bar"
@@ -7646,6 +7646,11 @@ msgid ""
msgstr ""
msgid ""
+"raw[-import]: import the options from a file (all lines containing commands "
+"are are executed)"
+msgstr ""
+
+msgid ""
"raw[-help]: force writing of help on options in exported file (see /help "
"fset.look.export_help_default)"
msgstr ""
diff --git a/po/ja.po b/po/ja.po
index d39d49e31..c9ab48a0d 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: 2024-03-25 12:05+0100\n"
+"POT-Creation-Date: 2024-03-25 20:59+0100\n"
"PO-Revision-Date: 2024-03-06 20:32+0100\n"
"Last-Translator: AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>\n"
"Language-Team: Japanese <https://github.com/l/weechat/tree/master/"
@@ -7825,11 +7825,17 @@ msgid "fast set WeeChat and plugins options"
msgstr "WeeChat とプラグインのオプションを高速設定"
#. TRANSLATORS: only text between angle brackets (eg: "<name>") must be translated
+#, fuzzy
+#| msgid ""
+#| "-bar || -refresh || -up|-down [<number>] || -left|-right [<percent>] || -"
+#| "go <line>|end || -toggle || -add [<value>] || -reset || -unset || -set || "
+#| "-setnew || -append || -mark || -format || -export [-help|-nohelp] "
+#| "<filename> || <filter>"
msgid ""
"-bar || -refresh || -up|-down [<number>] || -left|-right [<percent>] || -go "
"<line>|end || -toggle || -add [<value>] || -reset || -unset || -set || -"
"setnew || -append || -mark || -format || -export [-help|-nohelp] <filename> "
-"|| <filter>"
+"|| -import <filename> || <filter>"
msgstr ""
"-bar || -refresh || -up|-down [<number>] || -left|-right [<percent>] || -go "
"<line>|end || -toggle || -add [<value>] || -reset || -unset || -set || -"
@@ -7907,6 +7913,11 @@ msgid ""
msgstr ""
msgid ""
+"raw[-import]: import the options from a file (all lines containing commands "
+"are are executed)"
+msgstr ""
+
+msgid ""
"raw[-help]: force writing of help on options in exported file (see /help "
"fset.look.export_help_default)"
msgstr ""
diff --git a/po/pl.po b/po/pl.po
index 754bc30c0..014dc555d 100644
--- a/po/pl.po
+++ b/po/pl.po
@@ -22,7 +22,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2024-03-25 12:05+0100\n"
+"POT-Creation-Date: 2024-03-25 20:59+0100\n"
"PO-Revision-Date: 2024-03-06 20:32+0100\n"
"Last-Translator: Krzysztof Korościk <soltys@soltys.info>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -8081,11 +8081,17 @@ msgid "fast set WeeChat and plugins options"
msgstr "szybkie ustawianie opcji WeeChat i wtyczek"
#. TRANSLATORS: only text between angle brackets (eg: "<name>") must be translated
+#, fuzzy
+#| msgid ""
+#| "-bar || -refresh || -up|-down [<number>] || -left|-right [<percent>] || -"
+#| "go <line>|end || -toggle || -add [<value>] || -reset || -unset || -set || "
+#| "-setnew || -append || -mark || -format || -export [-help|-nohelp] "
+#| "<filename> || <filter>"
msgid ""
"-bar || -refresh || -up|-down [<number>] || -left|-right [<percent>] || -go "
"<line>|end || -toggle || -add [<value>] || -reset || -unset || -set || -"
"setnew || -append || -mark || -format || -export [-help|-nohelp] <filename> "
-"|| <filter>"
+"|| -import <filename> || <filter>"
msgstr ""
"-bar || -refresh || -up|-down [<ilość>] || -left|-right [<procent>] || -go "
"<linia>|end || -toggle || -add [<wartość>] || -reset || -unset || -set || -"
@@ -8174,6 +8180,11 @@ msgstr ""
"ma format: „/set nazwa wartość” lub „/unset nazwa”)"
msgid ""
+"raw[-import]: import the options from a file (all lines containing commands "
+"are are executed)"
+msgstr ""
+
+msgid ""
"raw[-help]: force writing of help on options in exported file (see /help "
"fset.look.export_help_default)"
msgstr ""
diff --git a/po/pt.po b/po/pt.po
index fac17b038..24f6b4068 100644
--- a/po/pt.po
+++ b/po/pt.po
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2024-03-25 12:05+0100\n"
+"POT-Creation-Date: 2024-03-25 20:59+0100\n"
"PO-Revision-Date: 2024-03-06 20:32+0100\n"
"Last-Translator: Vasco Almeida <vascomalmeida@sapo.pt>\n"
"Language-Team: Portuguese <>\n"
@@ -7816,7 +7816,7 @@ msgid ""
"-bar || -refresh || -up|-down [<number>] || -left|-right [<percent>] || -go "
"<line>|end || -toggle || -add [<value>] || -reset || -unset || -set || -"
"setnew || -append || -mark || -format || -export [-help|-nohelp] <filename> "
-"|| <filter>"
+"|| -import <filename> || <filter>"
msgstr ""
msgid "raw[-bar]: add the help bar"
@@ -7886,6 +7886,11 @@ msgid ""
msgstr ""
msgid ""
+"raw[-import]: import the options from a file (all lines containing commands "
+"are are executed)"
+msgstr ""
+
+msgid ""
"raw[-help]: force writing of help on options in exported file (see /help "
"fset.look.export_help_default)"
msgstr ""
diff --git a/po/pt_BR.po b/po/pt_BR.po
index 0a26f8180..f7c5b15f7 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: 2024-03-25 12:05+0100\n"
+"POT-Creation-Date: 2024-03-25 20:59+0100\n"
"PO-Revision-Date: 2024-02-17 10:07+0100\n"
"Last-Translator: Érico Nogueira <ericonr@disroot.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -7478,7 +7478,7 @@ msgid ""
"-bar || -refresh || -up|-down [<number>] || -left|-right [<percent>] || -go "
"<line>|end || -toggle || -add [<value>] || -reset || -unset || -set || -"
"setnew || -append || -mark || -format || -export [-help|-nohelp] <filename> "
-"|| <filter>"
+"|| -import <filename> || <filter>"
msgstr ""
msgid "raw[-bar]: add the help bar"
@@ -7548,6 +7548,11 @@ msgid ""
msgstr ""
msgid ""
+"raw[-import]: import the options from a file (all lines containing commands "
+"are are executed)"
+msgstr ""
+
+msgid ""
"raw[-help]: force writing of help on options in exported file (see /help "
"fset.look.export_help_default)"
msgstr ""
diff --git a/po/ru.po b/po/ru.po
index 8eebfc581..fbab6d8ab 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: 2024-03-25 12:05+0100\n"
+"POT-Creation-Date: 2024-03-25 20:59+0100\n"
"PO-Revision-Date: 2023-11-29 09:59+0100\n"
"Last-Translator: Aleksey V Zapparov AKA ixti <ixti@member.fsf.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -7109,7 +7109,7 @@ msgid ""
"-bar || -refresh || -up|-down [<number>] || -left|-right [<percent>] || -go "
"<line>|end || -toggle || -add [<value>] || -reset || -unset || -set || -"
"setnew || -append || -mark || -format || -export [-help|-nohelp] <filename> "
-"|| <filter>"
+"|| -import <filename> || <filter>"
msgstr ""
msgid "raw[-bar]: add the help bar"
@@ -7179,6 +7179,11 @@ msgid ""
msgstr ""
msgid ""
+"raw[-import]: import the options from a file (all lines containing commands "
+"are are executed)"
+msgstr ""
+
+msgid ""
"raw[-help]: force writing of help on options in exported file (see /help "
"fset.look.export_help_default)"
msgstr ""
diff --git a/po/sr.po b/po/sr.po
index 69eb11cb1..848795bde 100644
--- a/po/sr.po
+++ b/po/sr.po
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2024-03-25 12:05+0100\n"
+"POT-Creation-Date: 2024-03-25 20:59+0100\n"
"PO-Revision-Date: 2024-03-06 20:32+0100\n"
"Last-Translator: Ivan Pešić <ivan.pesic@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -8107,11 +8107,17 @@ msgid "fast set WeeChat and plugins options"
msgstr "брзо постављање опција за програм WeeChat и додатке"
#. TRANSLATORS: only text between angle brackets (eg: "<name>") must be translated
+#, fuzzy
+#| msgid ""
+#| "-bar || -refresh || -up|-down [<number>] || -left|-right [<percent>] || -"
+#| "go <line>|end || -toggle || -add [<value>] || -reset || -unset || -set || "
+#| "-setnew || -append || -mark || -format || -export [-help|-nohelp] "
+#| "<filename> || <filter>"
msgid ""
"-bar || -refresh || -up|-down [<number>] || -left|-right [<percent>] || -go "
"<line>|end || -toggle || -add [<value>] || -reset || -unset || -set || -"
"setnew || -append || -mark || -format || -export [-help|-nohelp] <filename> "
-"|| <filter>"
+"|| -import <filename> || <filter>"
msgstr ""
"-bar || -refresh || -up|-down [<број>] || -left|-right [<проценат>] || -go "
"<линија>|end || -toggle || -add [<вредн>] || -reset || -unset || -set || -"
@@ -8200,6 +8206,11 @@ msgstr ""
"линија има формат: „/set име вредност” или „/unset име”)"
msgid ""
+"raw[-import]: import the options from a file (all lines containing commands "
+"are are executed)"
+msgstr ""
+
+msgid ""
"raw[-help]: force writing of help on options in exported file (see /help "
"fset.look.export_help_default)"
msgstr ""
diff --git a/po/tr.po b/po/tr.po
index 942aa594a..cce8d2589 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: 2024-03-25 12:05+0100\n"
+"POT-Creation-Date: 2024-03-25 20:59+0100\n"
"PO-Revision-Date: 2024-03-06 20:33+0100\n"
"Last-Translator: Emir SARI <emir_sari@icloud.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -7911,11 +7911,17 @@ msgid "fast set WeeChat and plugins options"
msgstr "WeeChat ve eklenti seçeneklerini hızlıca ayarla"
#. TRANSLATORS: only text between angle brackets (eg: "<name>") must be translated
+#, fuzzy
+#| msgid ""
+#| "-bar || -refresh || -up|-down [<number>] || -left|-right [<percent>] || -"
+#| "go <line>|end || -toggle || -add [<value>] || -reset || -unset || -set || "
+#| "-setnew || -append || -mark || -format || -export [-help|-nohelp] "
+#| "<filename> || <filter>"
msgid ""
"-bar || -refresh || -up|-down [<number>] || -left|-right [<percent>] || -go "
"<line>|end || -toggle || -add [<value>] || -reset || -unset || -set || -"
"setnew || -append || -mark || -format || -export [-help|-nohelp] <filename> "
-"|| <filter>"
+"|| -import <filename> || <filter>"
msgstr ""
"-bar || -refresh || -up|-down [<sayı>] || -left|-right [<yüzde>] || -go "
"<satır>|end || -toggle || -add [<değer>] || -reset || -unset || -set || -"
@@ -7993,6 +7999,11 @@ msgid ""
msgstr ""
msgid ""
+"raw[-import]: import the options from a file (all lines containing commands "
+"are are executed)"
+msgstr ""
+
+msgid ""
"raw[-help]: force writing of help on options in exported file (see /help "
"fset.look.export_help_default)"
msgstr ""
diff --git a/po/weechat.pot b/po/weechat.pot
index 70ccdb000..62c201b9b 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: 2024-03-25 12:05+0100\n"
+"POT-Creation-Date: 2024-03-25 20:59+0100\n"
"PO-Revision-Date: 2014-08-16 10:27+0200\n"
"Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -6612,7 +6612,7 @@ msgid ""
"-bar || -refresh || -up|-down [<number>] || -left|-right [<percent>] || -go "
"<line>|end || -toggle || -add [<value>] || -reset || -unset || -set || -"
"setnew || -append || -mark || -format || -export [-help|-nohelp] <filename> "
-"|| <filter>"
+"|| -import <filename> || <filter>"
msgstr ""
msgid "raw[-bar]: add the help bar"
@@ -6682,6 +6682,11 @@ msgid ""
msgstr ""
msgid ""
+"raw[-import]: import the options from a file (all lines containing commands "
+"are are executed)"
+msgstr ""
+
+msgid ""
"raw[-help]: force writing of help on options in exported file (see /help "
"fset.look.export_help_default)"
msgstr ""
diff --git a/src/plugins/fset/fset-command.c b/src/plugins/fset/fset-command.c
index a3135107c..946c4c17f 100644
--- a/src/plugins/fset/fset-command.c
+++ b/src/plugins/fset/fset-command.c
@@ -423,6 +423,15 @@ fset_command_fset (const void *pointer, void *data,
return WEECHAT_RC_OK;
}
+ if (weechat_strcmp (argv[1], "-import") == 0)
+ {
+ if (argc < 3)
+ WEECHAT_COMMAND_ERROR;
+ if (!fset_option_import (argv_eol[2]))
+ WEECHAT_COMMAND_ERROR;
+ return WEECHAT_RC_OK;
+ }
+
WEECHAT_COMMAND_ERROR;
}
else
@@ -639,6 +648,7 @@ fset_command_init ()
" || -mark"
" || -format"
" || -export [-help|-nohelp] <filename>"
+ " || -import <filename>"
" || <filter>"),
WEECHAT_CMD_ARGS_DESC(
N_("raw[-bar]: add the help bar"),
@@ -666,6 +676,8 @@ fset_command_init ()
N_("raw[-format]: switch to the next available format"),
N_("raw[-export]: export the options and values displayed in a file "
"(each line has format: \"/set name value\" or \"/unset name\")"),
+ N_("raw[-import]: import the options from a file "
+ "(all lines containing commands are are executed)"),
N_("raw[-help]: force writing of help on options in exported file "
"(see /help fset.look.export_help_default)"),
N_("raw[-nohelp]: do not write help on options in exported file "
@@ -784,6 +796,7 @@ fset_command_init ()
" || -mark"
" || -format"
" || -export -help|-nohelp|%(filename) %(filename)"
+ " || -import %(filename)"
" || *|c:|f:|s:|d|d:|d=|d==|=|==|%(fset_options)",
&fset_command_fset, NULL, NULL);
weechat_hook_command_run ("/set", &fset_command_run_set_cb, NULL, NULL);
diff --git a/src/plugins/fset/fset-option.c b/src/plugins/fset/fset-option.c
index 2ef8c219d..a783d2f0e 100644
--- a/src/plugins/fset/fset-option.c
+++ b/src/plugins/fset/fset-option.c
@@ -1471,6 +1471,63 @@ fset_option_export (const char *filename, int with_help)
}
/*
+ * Imports options from a file: all lines starting with "/" are executed.
+ *
+ * Returns:
+ * 1: export OK
+ * 0: error
+ */
+
+int
+fset_option_import (const char *filename)
+{
+ char *filename2, line[4096], *ptr_line;
+ FILE *file;
+ int length;
+
+ filename2 = weechat_string_expand_home (filename);
+ if (!filename2)
+ return 0;
+
+ file = fopen (filename2, "r");
+ if (!file)
+ {
+ free (filename2);
+ return 0;
+ }
+
+ while (!feof (file))
+ {
+ ptr_line = fgets (line, sizeof (line) - 1, file);
+ if (!ptr_line)
+ continue;
+ /* ignore comments */
+ if (ptr_line[0] == '#')
+ continue;
+ /* execute command (if it's a valid command) */
+ if (!weechat_string_input_for_buffer (ptr_line))
+ {
+ /* remove trailing '\r' and '\n' */
+ length = strlen (line) - 1;
+ while ((length >= 0)
+ && ((line[length] == '\n')
+ || (line[length] == '\r')))
+ {
+ line[length] = '\0';
+ length--;
+ }
+ weechat_command (NULL, ptr_line);
+ }
+ }
+
+ fclose (file);
+
+ free (filename2);
+
+ return 1;
+}
+
+/*
* Refreshes the fset buffer after the change of an option.
*/
diff --git a/src/plugins/fset/fset-option.h b/src/plugins/fset/fset-option.h
index 82be59c73..b8266274d 100644
--- a/src/plugins/fset/fset-option.h
+++ b/src/plugins/fset/fset-option.h
@@ -121,6 +121,7 @@ extern void fset_option_mark_options_matching_filter (const char *filter,
int mark);
extern void fset_option_unmark_all ();
extern int fset_option_export (const char *filename, int with_help);
+extern int fset_option_import (const char *filename);
extern int fset_option_config_cb (const void *pointer,
void *data,
const char *option,