Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to support glob? #20

Open
darren opened this issue Jul 30, 2015 · 0 comments
Open

how to support glob? #20

darren opened this issue Jul 30, 2015 · 0 comments

Comments

@darren
Copy link

darren commented Jul 30, 2015

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
ThinkChaos pushed a commit to ThinkChaos/pflag that referenced this issue Feb 28, 2022
Fix '--flag arg' and Allow flags to take optional arguments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant