Ejemplo n.º 1
0
func main() {
	app := cli.NewApp("foo-cli")

	app.Register("say-hello", &cli.Command{
		Desc: "Says hello. It accepts arguments.",
		Run:  SayHelloCmd,
	})

	t := cli.BasicTerm(os.Stdout, os.Stderr)
	os.Exit(app.Run(t, os.Args[1:]...))
}
Ejemplo n.º 2
0
func main() {
	app := cli.NewApp("storagetool")

	app.Register("dump-heads", &cli.Command{
		Desc: "dump metadata of a heads.db checkpoint file",
		Run:  DumpHeadsCmd,
	})

	app.Register("version", &cli.Command{
		Desc: "print the version of this binary",
		Run:  VersionCmd,
	})

	t := cli.BasicTerm(os.Stdout, os.Stderr)
	os.Exit(app.Run(t, os.Args[1:]...))
}
Ejemplo n.º 3
0
func main() {
	app := cli.NewApp("promtool")

	app.Register("check-config", &cli.Command{
		Desc: "validate configuration files for correctness",
		Run:  CheckConfigCmd,
	})

	app.Register("check-rules", &cli.Command{
		Desc: "validate rule files for correctness",
		Run:  CheckRulesCmd,
	})

	app.Register("version", &cli.Command{
		Desc: "print the version of this binary",
		Run:  VersionCmd,
	})

	t := cli.BasicTerm(os.Stdout, os.Stderr)
	os.Exit(app.Run(t, os.Args[1:]...))
}