flag notes
This commit is contained in:
parent
47dbd1c9e9
commit
8612ba6589
@ -3,7 +3,7 @@ package main
|
|||||||
import ("fmt"; "flag")
|
import ("fmt"; "flag")
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
maxp := flag.Int("repeat", 3, "number of times to repeat arguments")
|
maxp := flag.Int("repeat", 3, "time to repeat args")
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
for i := 0; i < *maxp; i++ {
|
for i := 0; i < *maxp; i++ {
|
||||||
for _, arg := range flag.Args() {
|
for _, arg := range flag.Args() {
|
||||||
@ -11,3 +11,9 @@ func main() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// todoo
|
||||||
|
// multiple flags
|
||||||
|
// trailing args
|
||||||
|
// arg escaping
|
||||||
|
// help text and usage errors
|
||||||
|
Loading…
x
Reference in New Issue
Block a user