Skip to content

Commit

Permalink
fix: support ipv6 on argument line as well.
Browse files Browse the repository at this point in the history
  • Loading branch information
UmanShahzad committed Aug 16, 2021
1 parent 91eeb9a commit dc98712
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions lib/cmd_cidr2range.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,16 @@ func CmdCIDR2Range(
f, err := os.Open(arg)
if err != nil {
// is it a CIDR?
if r, err := IPRangeStrFromCIDR(arg); err == nil {
fmt.Println(r.String())
continue
if strings.IndexByte(arg, ':') == -1 {
if r, err := IPRangeStrFromCIDR(arg); err == nil {
fmt.Println(r.String())
continue
}
} else {
if r, err := IP6RangeStrFromCIDR(arg); err == nil {
fmt.Println(r.String())
continue
}
}

// invalid file arg.
Expand Down

0 comments on commit dc98712

Please sign in to comment.