From 07b598ff2875f5c86da6546f075d3ed7a1a45b0f Mon Sep 17 00:00:00 2001 From: tersec Date: Thu, 26 Oct 2023 02:30:34 +0000 Subject: [PATCH] add IpAddress equivalents for ValidIpAddress support (#94) --- confutils/std/net.nim | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/confutils/std/net.nim b/confutils/std/net.nim index b74b1a0..5100c8d 100644 --- a/confutils/std/net.nim +++ b/confutils/std/net.nim @@ -11,6 +11,13 @@ func completeCmdArg*(T: type ValidIpAddress, val: string): seq[string] = # TODO: Maybe complete the local IP address? @[] +func parseCmdArg*(T: type IpAddress, s: string): T = + parseIpAddress(s) + +func completeCmdArg*(T: type IpAddress, val: string): seq[string] = + # TODO: Maybe complete the local IP address? + @[] + func parseCmdArg*(T: type Port, s: string): T = template fail = raise newException(ValueError,