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", 100, "") tmout = flag.Int("timeout", 1000, "") 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, } }