Skip to content

Linux + iPhone Continuity / iMessage / SMS

fix: add `--version` flag to cli

Zack Bartel0da906fe0787
diff --git a/.github/SECURITY.md b/.github/SECURITY.md
index 177b6ed..7c3f0db 100644
--- a/.github/SECURITY.md
+++ b/.github/SECURITY.md
@@ -17,8 +17,7 @@ and a public report is a working exploit until they upgrade.
A good report includes:
-- The Tether version — the release tag, or the package version from your
- package manager — and how it was installed (AUR, `.deb`,
+- The version (`tether --version`) and how it was installed (AUR, `.deb`,
`.rpm`, source).
- Distro and Wayland compositor. For Bluetooth issues,
`tether --bt-diagnostics` prints a redacted report that covers the
@@ -48,7 +47,7 @@ Tether is pre-1.0 and moves fast. Only the latest tagged release receives
security fixes; there are no backports to older tags. Fixes ship as a new
release, which the distro packages follow.
-Compare what you are running against the
+Check what you are running with `tether --version` and compare against the
[latest release](https://github.com/zackb/tether/releases/latest).
## Scope
diff --git a/docs/man/man1/tether.1.in b/docs/man/man1/tether.1.in
index 42432e3..f9f636e 100644
--- a/docs/man/man1/tether.1.in
+++ b/docs/man/man1/tether.1.in
@@ -14,6 +14,9 @@ a Linux Wayland desktop and an iOS device.
\fB\-h, \-\-help\fR
Show help message and exit.
.TP
+\fB\-v, \-\-version\fR
+Print the tether version and exit.
+.TP
\fB\-g, \-\-get-clipboard\fR
Retrieve the current Wayland clipboard text from the daemon.
.TP
diff --git a/po/cs.po b/po/cs.po
index 1e94aa3..f40e356 100644
--- a/po/cs.po
+++ b/po/cs.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-08-28 20:29-0700\n"
+"POT-Creation-Date: 2026-08-30 11:33-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Czech\n"
@@ -30,6 +30,10 @@ msgstr "ne"
msgid "Show this help message."
msgstr "Zobrazit tuto nápovědu."
+#: src/cli/main.cpp
+msgid "Print the tether version."
+msgstr "Vypsat verzi tether."
+
#: src/cli/main.cpp
msgid "Retrieve the current Wayland clipboard text."
msgstr "Získat aktuální text ze schránky Waylandu."
diff --git a/po/de.po b/po/de.po
index 553865f..08446fc 100644
--- a/po/de.po
+++ b/po/de.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-08-28 20:29-0700\n"
+"POT-Creation-Date: 2026-08-30 11:33-0700\n"
"PO-Revision-Date: 2026-08-22\n"
"Last-Translator: Tether project\n"
"Language-Team: German\n"
@@ -30,6 +30,10 @@ msgstr "nein"
msgid "Show this help message."
msgstr "Diese Hilfe anzeigen."
+#: src/cli/main.cpp
+msgid "Print the tether version."
+msgstr "Die tether-Version ausgeben."
+
#: src/cli/main.cpp
msgid "Retrieve the current Wayland clipboard text."
msgstr "Den aktuellen Text der Wayland-Zwischenablage abrufen."
diff --git a/po/es.po b/po/es.po
index 1de7b61..83e91c9 100644
--- a/po/es.po
+++ b/po/es.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-08-28 20:29-0700\n"
+"POT-Creation-Date: 2026-08-30 11:33-0700\n"
"PO-Revision-Date: 2026-08-22\n"
"Last-Translator: Tether project\n"
"Language-Team: Spanish\n"
@@ -30,6 +30,10 @@ msgstr "no"
msgid "Show this help message."
msgstr "Mostrar esta ayuda."
+#: src/cli/main.cpp
+msgid "Print the tether version."
+msgstr "Mostrar la versión de tether."
+
#: src/cli/main.cpp
msgid "Retrieve the current Wayland clipboard text."
msgstr "Obtener el texto actual del portapapeles de Wayland."
diff --git a/po/fr.po b/po/fr.po
index 76cec9a..ec86f1b 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-08-28 20:29-0700\n"
+"POT-Creation-Date: 2026-08-30 11:33-0700\n"
"PO-Revision-Date: 2026-08-22\n"
"Last-Translator: Tether project\n"
"Language-Team: French\n"
@@ -30,6 +30,10 @@ msgstr "non"
msgid "Show this help message."
msgstr "Afficher cette aide."
+#: src/cli/main.cpp
+msgid "Print the tether version."
+msgstr "Afficher la version de tether."
+
#: src/cli/main.cpp
msgid "Retrieve the current Wayland clipboard text."
msgstr "Récupérer le texte actuel du presse-papiers Wayland."
diff --git a/po/it.po b/po/it.po
index 90aaf14..fb501ab 100644
--- a/po/it.po
+++ b/po/it.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-08-28 20:29-0700\n"
+"POT-Creation-Date: 2026-08-30 11:33-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Italian\n"
@@ -30,6 +30,10 @@ msgstr "no"
msgid "Show this help message."
msgstr "Mostra questo messaggio di aiuto."
+#: src/cli/main.cpp
+msgid "Print the tether version."
+msgstr "Mostra la versione di tether."
+
#: src/cli/main.cpp
msgid "Retrieve the current Wayland clipboard text."
msgstr "Recupera il testo attuale degli appunti di Wayland."
diff --git a/po/ja.po b/po/ja.po
index 25369c4..97e5ba9 100644
--- a/po/ja.po
+++ b/po/ja.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-08-28 20:29-0700\n"
+"POT-Creation-Date: 2026-08-30 11:33-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Japanese\n"
@@ -30,6 +30,10 @@ msgstr "いいえ"
msgid "Show this help message."
msgstr "このヘルプを表示します。"
+#: src/cli/main.cpp
+msgid "Print the tether version."
+msgstr "tether のバージョンを表示します。"
+
#: src/cli/main.cpp
msgid "Retrieve the current Wayland clipboard text."
msgstr "Wayland のクリップボードの現在のテキストを取得します。"
diff --git a/po/ko.po b/po/ko.po
index ee0572d..94f1488 100644
--- a/po/ko.po
+++ b/po/ko.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-08-28 20:29-0700\n"
+"POT-Creation-Date: 2026-08-30 11:33-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Korean\n"
@@ -30,6 +30,10 @@ msgstr "아니오"
msgid "Show this help message."
msgstr "이 도움말을 표시합니다."
+#: src/cli/main.cpp
+msgid "Print the tether version."
+msgstr "tether 버전을 표시합니다."
+
#: src/cli/main.cpp
msgid "Retrieve the current Wayland clipboard text."
msgstr "Wayland 클립보드의 현재 텍스트를 가져옵니다."
diff --git a/po/nl.po b/po/nl.po
index 4a36e1b..bc2bec2 100644
--- a/po/nl.po
+++ b/po/nl.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-08-28 20:29-0700\n"
+"POT-Creation-Date: 2026-08-30 11:33-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Dutch\n"
@@ -30,6 +30,10 @@ msgstr "nee"
msgid "Show this help message."
msgstr "Deze hulptekst tonen."
+#: src/cli/main.cpp
+msgid "Print the tether version."
+msgstr "De tether-versie tonen."
+
#: src/cli/main.cpp
msgid "Retrieve the current Wayland clipboard text."
msgstr "De huidige tekst van het Wayland-klembord ophalen."
diff --git a/po/pl.po b/po/pl.po
index 364cfe4..cf51407 100644
--- a/po/pl.po
+++ b/po/pl.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-08-28 20:29-0700\n"
+"POT-Creation-Date: 2026-08-30 11:33-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Polish\n"
@@ -31,6 +31,10 @@ msgstr "nie"
msgid "Show this help message."
msgstr "Wyświetl tę pomoc."
+#: src/cli/main.cpp
+msgid "Print the tether version."
+msgstr "Wyświetl wersję tether."
+
#: src/cli/main.cpp
msgid "Retrieve the current Wayland clipboard text."
msgstr "Pobierz bieżący tekst ze schowka Waylanda."
diff --git a/po/pt_BR.po b/po/pt_BR.po
index 594bd73..7b94fd7 100644
--- a/po/pt_BR.po
+++ b/po/pt_BR.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-08-28 20:29-0700\n"
+"POT-Creation-Date: 2026-08-30 11:33-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Brazilian Portuguese\n"
@@ -30,6 +30,10 @@ msgstr "não"
msgid "Show this help message."
msgstr "Mostrar esta mensagem de ajuda."
+#: src/cli/main.cpp
+msgid "Print the tether version."
+msgstr "Mostrar a versão do tether."
+
#: src/cli/main.cpp
msgid "Retrieve the current Wayland clipboard text."
msgstr "Obter o texto atual da área de transferência do Wayland."
diff --git a/po/ru.po b/po/ru.po
index 1a7b460..a92b6cd 100644
--- a/po/ru.po
+++ b/po/ru.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-08-28 20:29-0700\n"
+"POT-Creation-Date: 2026-08-30 11:33-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Russian\n"
@@ -31,6 +31,10 @@ msgstr "нет"
msgid "Show this help message."
msgstr "Показать эту справку."
+#: src/cli/main.cpp
+msgid "Print the tether version."
+msgstr "Показать версию tether."
+
#: src/cli/main.cpp
msgid "Retrieve the current Wayland clipboard text."
msgstr "Получить текущий текст из буфера обмена Wayland."
diff --git a/po/sv.po b/po/sv.po
index ce4fdd0..d70162b 100644
--- a/po/sv.po
+++ b/po/sv.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-08-28 20:29-0700\n"
+"POT-Creation-Date: 2026-08-30 11:33-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Swedish\n"
@@ -30,6 +30,10 @@ msgstr "nej"
msgid "Show this help message."
msgstr "Visa den här hjälptexten."
+#: src/cli/main.cpp
+msgid "Print the tether version."
+msgstr "Visa tether-versionen."
+
#: src/cli/main.cpp
msgid "Retrieve the current Wayland clipboard text."
msgstr "Hämta den aktuella texten i Waylands urklipp."
diff --git a/po/tether.pot b/po/tether.pot
index 7cea982..4afc9f8 100644
--- a/po/tether.pot
+++ b/po/tether.pot
@@ -6,9 +6,9 @@
#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: tether 0.2.17\n"
+"Project-Id-Version: tether 0.2.18\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-08-29 20:15-0700\n"
+"POT-Creation-Date: 2026-08-30 11:33-0700\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
@@ -30,6 +30,10 @@ msgstr ""
msgid "Show this help message."
msgstr ""
+#: src/cli/main.cpp
+msgid "Print the tether version."
+msgstr ""
+
#: src/cli/main.cpp
msgid "Retrieve the current Wayland clipboard text."
msgstr ""
diff --git a/po/tr.po b/po/tr.po
index 8962a7e..0e21737 100644
--- a/po/tr.po
+++ b/po/tr.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-08-28 20:29-0700\n"
+"POT-Creation-Date: 2026-08-30 11:33-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Turkish\n"
@@ -30,6 +30,10 @@ msgstr "hayır"
msgid "Show this help message."
msgstr "Bu yardım iletisini göster."
+#: src/cli/main.cpp
+msgid "Print the tether version."
+msgstr "tether sürümünü yazdır."
+
#: src/cli/main.cpp
msgid "Retrieve the current Wayland clipboard text."
msgstr "Wayland panosundaki güncel metni al."
diff --git a/po/uk.po b/po/uk.po
index 8225eb9..c4fc407 100644
--- a/po/uk.po
+++ b/po/uk.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-08-28 20:29-0700\n"
+"POT-Creation-Date: 2026-08-30 11:33-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Ukrainian\n"
@@ -31,6 +31,10 @@ msgstr "ні"
msgid "Show this help message."
msgstr "Показати цю довідку."
+#: src/cli/main.cpp
+msgid "Print the tether version."
+msgstr "Показати версію tether."
+
#: src/cli/main.cpp
msgid "Retrieve the current Wayland clipboard text."
msgstr "Отримати поточний текст із буфера обміну Wayland."
diff --git a/po/zh_CN.po b/po/zh_CN.po
index a16965d..b8318fa 100644
--- a/po/zh_CN.po
+++ b/po/zh_CN.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-08-28 20:29-0700\n"
+"POT-Creation-Date: 2026-08-30 11:33-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Simplified Chinese\n"
@@ -30,6 +30,10 @@ msgstr "否"
msgid "Show this help message."
msgstr "显示此帮助信息。"
+#: src/cli/main.cpp
+msgid "Print the tether version."
+msgstr "显示 tether 版本。"
+
#: src/cli/main.cpp
msgid "Retrieve the current Wayland clipboard text."
msgstr "获取 Wayland 剪贴板中的当前文本。"
diff --git a/src/cli/main.cpp b/src/cli/main.cpp
index a7e6e12..4266246 100644
--- a/src/cli/main.cpp
+++ b/src/cli/main.cpp
@@ -10,6 +10,7 @@
#include <string>
#include <sys/ioctl.h>
#include <tether/client.hpp>
+#include <tether/core.hpp>
#include <tether/crypto.hpp>
#include <tether/discovery.hpp>
#include <tether/i18n.hpp>
@@ -170,6 +171,7 @@ struct Opt {
static const Opt kOptions[] = {
{"-h, --help", N_("Show this help message.")},
+ {"-v, --version", N_("Print the tether version.")},
{"-g, --get-clipboard", N_("Retrieve the current Wayland clipboard text.")},
{"-s, --set-clipboard", N_("Take string input and copy it to the local Wayland clipboard.")},
{"-f, --send-file", N_("Send a file through tether.")},
@@ -685,6 +687,9 @@ int main(int argc, char* argv[]) {
if (arg == "-h" || arg == "--help") {
print_help();
return 0;
+ } else if (arg == "-v" || arg == "--version") {
+ fprintf(stdout, "tether %s\n", tether::get_version().c_str());
+ return 0;
} else if (arg == "-g" || arg == "--get-clipboard") {
action = "get";
} else if (arg == "-d" || arg == "--discover") {