README ¶ defaults example <tmpl,code=go:cat defaults.go> package main import ( "fmt" "github.com/jpillora/opts" ) type Config struct { Foo string Bar string } func main() { c := Config{ Bar: "moon", } opts.Parse(&c) fmt.Println(c.Foo) fmt.Println(c.Bar) } ``` $ defaults --foo hello ``` ``` plain hello moon ``` ``` $ defaults --help ``` ``` plain Usage: defaults [options] Options: --foo, -f --bar, -b default moon --help, -h </tmpl> Expand ▾ Collapse ▴ Documentation ¶ There is no documentation for this package. Source Files ¶ View all Source files defaults.go Click to show internal directories. Click to hide internal directories.