Exemplo n.º 1
0
func main() {
	adaptflag.AdaptWithFunc(func(info adaptflag.Info) {
		flag.Var(info.Value, info.Name, info.Usage)
	})

	flag.Parse()
}
Exemplo n.º 2
0
func main() {
	tgt := &Config{}
	c := cstruct.MustNew(tgt, "example")
	configurable.Register(c)

	adaptflag.AdaptWithFunc(func(info adaptflag.Info) {
		flag.Var(info.Value, info.Name, info.Usage)
	})

	flag.Parse()

	err := adaptconf.Load("exampleapp2")
	if err != nil {
		fmt.Printf("%v\n", err)
	}

	fmt.Printf("%#v\n", tgt)
}