Esempio n. 1
0
File: cli.go Progetto: Byron/godi
// Check common args and init a command with them.
// Further init and checking should be done in specialized function
func CheckCommonFlagsAndInit(cmd api.Runner, c *cli.Context) error {
	nr, level, filters, err := CheckCommonFlags(c)
	if err != nil {
		return err
	}

	return cmd.Init(nr, nr, c.Args(), level, filters)
}
Esempio n. 2
0
File: cli.go Progetto: Byron/godi
// Runs a standard runner from within the cli, dealing with errors accoringly
func RunAction(cmd api.Runner, c *cli.Context) {
	handler := MakeLogHandler(cmd.LogLevel())
	err := api.StartEngine(cmd, handler)
	nerr := CliFinishApp(c)
	if err != nil || nerr != nil {
		os.Exit(1)
	}
}