pflag icon indicating copy to clipboard operation
pflag copied to clipboard

how to support glob?

Open darren opened this issue 10 years ago • 0 comments

var files = flag.StringSlice("files", "", "")

for _, file := range *files {
     fmt.Println(file)
}

./p --files a b c -b xxx

which prints:
a
b
c
#now if I got three files
$ ls *.txt
a.txt b.txt c.txt

./p --files *.txt -b xxx
#shall print:
a.txt
b.txt
c.txt

darren avatar Jul 30 '15 09:07 darren