コード例 #1
0
ファイル: simple2.go プロジェクト: pmwoodward3/torrentsaga
func main() {
	foo := FooConfig{
		Bravo: 42,
		Delta: 2 * time.Minute,
	}
	opts.Parse(&foo)
}
コード例 #2
0
ファイル: intro.go プロジェクト: CaptainIlu/cloud-torrent
func main() {
	config := struct {
		File  string `help:"file to load"`
		Lines int    `help:"number of lines to show"`
	}{}
	opts.Parse(&config)
	fmt.Println(config)
}
コード例 #3
0
func main() {

	c := Config{}

	opts.Parse(&c)

	fmt.Printf("%3.0f %s %d\n", c.Foo.Seconds(), c.Bar, c.Bazz)
}
コード例 #4
0
ファイル: simple.go プロジェクト: pmwoodward3/torrentsaga
func main() {

	c := Config{}

	opts.Parse(&c)

	fmt.Println(c.Foo)
	fmt.Println(c.Bar)
}
コード例 #5
0
ファイル: cmds.go プロジェクト: CaptainIlu/cloud-torrent
func main() {

	c := Config{}

	opts.Parse(&c)

	fmt.Println(c.Cmd)
	fmt.Println(c.Bar.Zip)
	fmt.Println(c.Bar.Zap)
}
コード例 #6
0
ファイル: main.go プロジェクト: efueger/overseer
func main() {
	c := struct {
		URL  string `type:"arg" help:"<url> of where to GET the binary"`
		Port int    `help:"listening port"`
		Log  bool   `help:"enable logging"`
	}{
		Port: 3000,
		Log:  true,
	}
	opts.Parse(&c)
	overseer.Run(overseer.Config{
		Log: c.Log,
		Program: func(state overseer.State) {
			//noop
			select {}
		},
		Address: ":" + strconv.Itoa(c.Port),
		Fetcher: &fetcher.HTTP{
			URL:      c.URL,
			Interval: 1 * time.Second,
		},
	})
}