Example
b := flagp.Bool("b", false, "bool") dirs := flagp.StringSlice("d", []string{}, "需要操作的文件/目录, tab切起来") n := flagp.Int("n", 0, "number") xFiles := flagp.StringSlice("x", []string{}, "需要忽略的文件/目录, tab切起来") flagp.Parse() flagp.Usage() fmt.Println("dirs = ", *dirs, "xFiles = ", *xFiles, "n = ", *n, "b = ", *b) $ go run upfl.go -b -d hehe/ xx/ -n 123 -x xx/ dd/ Usage of upfl: -b bool -d []string 需要操作的文件/目录, tab切起来 -n int number -x []string 需要忽略的文件/目录, tab切起来 dirs = [hehe/ xx/] , xFiles = [xx/ dd/] , n = 123 , b = true