Skip to content

Commit

Permalink
add IpAddress equivalents for ValidIpAddress support (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
tersec committed Oct 26, 2023
1 parent 674c9e4 commit 07b598f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions confutils/std/net.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 07b598f

Please sign in to comment.