38 lines
580 B
Go
38 lines
580 B
Go
package common
|
|
|
|
import (
|
|
"flag"
|
|
)
|
|
|
|
type Params struct {
|
|
List string
|
|
Cidr string
|
|
Threads int
|
|
Tmout int
|
|
Delay int
|
|
Silent bool
|
|
}
|
|
|
|
var (
|
|
list = flag.String("l", "", "")
|
|
cidr = flag.String("r", "", "")
|
|
threads = flag.Int("t", 50, "")
|
|
tmout = flag.Int("timeout", 500, "")
|
|
delay = flag.Int("delay", 200, "")
|
|
silent = flag.Bool("s", false, "")
|
|
Conf Params
|
|
)
|
|
|
|
func LoadParams() {
|
|
flag.Usage = Usage
|
|
flag.Parse()
|
|
Conf = Params{
|
|
List: *list,
|
|
Cidr: *cidr,
|
|
Threads: *threads,
|
|
Tmout: *tmout,
|
|
Delay: *delay,
|
|
Silent: *silent,
|
|
}
|
|
}
|