2024-11-21 06:16:20 +00:00
|
|
|
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", "", "")
|
2024-11-30 22:11:38 +00:00
|
|
|
threads = flag.Int("t", 100, "")
|
|
|
|
tmout = flag.Int("timeout", 1000, "")
|
2024-11-21 06:16:20 +00:00
|
|
|
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,
|
|
|
|
}
|
|
|
|
}
|