func parseRanges() error { for _, r := range ranges { a, err := opt.ParseRange(r) if err != nil { return err } from, to := a.P0, a.P1 addrs = append(addrs, a) if from > 0 && nhd < from { nhd = from } if to > 0 && nhd < to { nhd = to } if from < 0 && ntl < -from { ntl = -from } if to < 0 && ntl < -to { ntl = -to } if from > 0 && to < 0 { nfrom = from } if from < 0 && to > 0 { nfrom = to } if from == 1 && to == -1 { all = true } } return nil }
func parseRanges() error { for _, r := range ranges { a, err := opt.ParseRange(r) if err != nil { return err } if a.P0 == 1 && a.P1 == -1 { all = true } addrs = append(addrs, a) } return nil }