blob: a5c459f10781f4e1cb089d321a12128c2da80fd2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
package envflag
import (
"flag"
"os"
)
func ExampleFlag() {
flag.Bool("verbose", false, "Be verbose")
Parse()
}
func ExampleFlagSet() {
fs := flag.NewFlagSet("example", flag.ExitOnError)
fs.Bool("verbose", false, "Be verbose")
ParseFlagSet(fs, os.Args[1:])
}
func ExamplePrefix() {
flag.String("db", "", "Database thing")
Parse(Prefix("APP_"))
}
|