Mention flags in the README
diff --git a/README.md b/README.md index da3af46..b3b2e5c 100644 --- a/README.md +++ b/README.md
@@ -30,7 +30,10 @@ --------------- ```go -import "github.com/magiconair/properties" +import ( + "flag" + "github.com/magiconair/properties" +) func main() { p := properties.MustLoadFile("${HOME}/config.properties", properties.UTF8) @@ -39,7 +42,7 @@ host := p.MustGetString("host") port := p.GetInt("port", 8080) - // or via decode + // or via decode type Config struct { Host string `properties:"host"` Port int `properties:"port,default=9000"` @@ -50,6 +53,9 @@ if err := p.Decode(&cfg); err != nil { log.Fatal(err) } + + // or via flags + p.MustFlag(flag.CommandLine) } ```