func exec()

in cmd/core/exec.go [27:47]


func exec(p CommandParams, e executor, gs ...OptionsGenerator) cobraRunE {
	return func(cmd *cobra.Command, args []string) error {
		o, err := GenerateOptions(cmd, args, gs...)
		if err != nil {
			return err
		}

		params, err := p(cmd, o)
		if err != nil {
			return err
		}

		// We want runtime errors to be logged and not trigger help message
		if err := e(params, o); err != nil {
			log.Errorf("Error: %v\n", err)
			os.Exit(1)
		}

		return nil
	}
}