Beispiel #1
0
func fatalOnError(command func(context *cli.Context) error) func(context *cli.Context) {
	return func(context *cli.Context) {
		if err := command(context); err != nil {
			log.Error(err)
		}
	}
}
Beispiel #2
0
func main() {
	app := cli.NewApp()
	app.Name = path.Base(os.Args[0])
	app.Author = "y_uuki"
	app.Email = "https://github.com/yuuki/droot"
	app.Commands = commands.Commands
	app.CommandNotFound = cmdNotFound
	app.Usage = "droot is a super-easy container with chroot without docker."
	app.Version = Version

	app.Flags = []cli.Flag{
		cli.BoolFlag{
			Name:  "debug, D",
			Usage: "Enable debug mode",
		},
	}

	if err := app.Run(os.Args); err != nil {
		log.Error(err)
	}
}