From 990ecc23506cea115cc41a2856da9d3453df98bf Mon Sep 17 00:00:00 2001 From: Ian McEwen Date: Thu, 25 Jun 2026 14:46:45 -0700 Subject: [PATCH] Better document how to specify a port when using TCP connection Fixes #868 Also, fix a pylint complaint. --- meshtastic/__main__.py | 4 +++- meshtastic/tests/test_main.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/meshtastic/__main__.py b/meshtastic/__main__.py index 9fa2a4aae..4e7556a96 100644 --- a/meshtastic/__main__.py +++ b/meshtastic/__main__.py @@ -1621,10 +1621,12 @@ def addConnectionArgs(parser: argparse.ArgumentParser) -> argparse.ArgumentParse "--host", "--tcp", "-t", - help="Connect to a device using TCP, optionally passing hostname or IP address to use. (defaults to '%(const)s')", + help=("Connect to a device using TCP, optionally passing hostname or IP address to use. (defaults to '%(const)s'). " + "A port number may be specified as well, e.g. meshtastic.local:4404. The default port is 4403."), nargs="?", default=None, const="localhost", + metavar="HOST[:PORT]", ) group.add_argument( diff --git a/meshtastic/tests/test_main.py b/meshtastic/tests/test_main.py index 90dc8579d..b2dda97cd 100644 --- a/meshtastic/tests/test_main.py +++ b/meshtastic/tests/test_main.py @@ -3157,7 +3157,7 @@ def test_main_ota_update_file_not_found(capsys): assert pytest_wrapped_e.type == SystemExit assert pytest_wrapped_e.value.code == 1 - out, err = capsys.readouterr() + out, _ = capsys.readouterr() assert "OTA firmware file not found" in out assert "/nonexistent/firmware.bin" in out