Skip to content
/ flen Public

A simple command flag and environment variable parsing library

License

Notifications You must be signed in to change notification settings

osm/flen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

flen

A simple command flag and environment variable parsing library

Example

$ cat > test.go <<EOF
package main

import (
        "flag"
        "fmt"

        "github.com/osm/flen"
)

func main() {
        name := flag.String("name", "foo", "A name")
        flen.SetEnvPrefix("TEST")
        flen.Parse()

        fmt.Println("hello", *name)
}
EOF

$ go run test.go
hello foo

$ TEST_NAME=bar go run test.go
hello bar

$ go run test.go -name baz
hello baz

About

A simple command flag and environment variable parsing library

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages