add IpAddress equivalents for ValidIpAddress support (#94)

This commit is contained in:
tersec 2023-10-26 02:30:34 +00:00 committed by GitHub
parent 674c9e4c8e
commit 07b598ff28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -11,6 +11,13 @@ func completeCmdArg*(T: type ValidIpAddress, val: string): seq[string] =
# TODO: Maybe complete the local IP address? # 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 = func parseCmdArg*(T: type Port, s: string): T =
template fail = template fail =
raise newException(ValueError, raise newException(ValueError,