flag notes

This commit is contained in:
Mark McGranaghan 2012-09-21 08:28:40 -07:00
parent 47dbd1c9e9
commit 8612ba6589

View File

@ -3,7 +3,7 @@ package main
import ("fmt"; "flag")
func main() {
maxp := flag.Int("repeat", 3, "number of times to repeat arguments")
maxp := flag.Int("repeat", 3, "time to repeat args")
flag.Parse()
for i := 0; i < *maxp; i++ {
for _, arg := range flag.Args() {
@ -11,3 +11,9 @@ func main() {
}
}
}
// todoo
// multiple flags
// trailing args
// arg escaping
// help text and usage errors