Skip to content

Commit 60f8af3

Browse files
committed
Code cleanup.
1 parent 3b7ef13 commit 60f8af3

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

examples/icmp_echo_client.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,11 +204,10 @@ def _thread__client(self) -> None:
204204
default=None,
205205
help="IPv4 gateway address to be assigned to the interface.",
206206
)
207-
@click.option(
208-
"--remote-ip-address",
207+
@click.argument(
208+
"remote_ip_address",
209209
type=ClickTypeIpAddress(),
210210
required=True,
211-
help="Remote IP address to be pinged.",
212211
)
213212
def cli(
214213
*,
@@ -249,6 +248,10 @@ def cli(
249248
local_ip_address=ip4_host.address if ip4_host else Ip4Address(),
250249
remote_ip_address=remote_ip_address,
251250
)
251+
case _:
252+
raise ValueError(
253+
f"Unsupported IP version: {remote_ip_address.version}"
254+
)
252255

253256
try:
254257
stack.start()

examples/tcp_echo_client.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,11 +181,10 @@ def _thread__client(self) -> None:
181181
default=None,
182182
help="IPv4 gateway address to be assigned to the interface.",
183183
)
184-
@click.option(
185-
"--remote-ip-address",
184+
@click.argument(
185+
"remote_ip_address",
186186
type=ClickTypeIpAddress(),
187187
required=True,
188-
help="Remote IP address of the TCP Echo server.",
189188
)
190189
def cli(
191190
*,

examples/udp_echo_client.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,10 @@ def _thread__client(self) -> None:
162162
default=None,
163163
help="IPv4 gateway address to be assigned to the interface.",
164164
)
165-
@click.option(
166-
"--remote-ip-address",
165+
@click.argument(
166+
"remote_ip_address",
167167
type=ClickTypeIpAddress(),
168168
required=True,
169-
help="Remote IP address of the UDP Echo server.",
170169
)
171170
def cli(
172171
*,

requirements_dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ twine
1212
ipython
1313
pyupgrade
1414
parameterized
15+
types-click

0 commit comments

Comments
 (0)