INNER CODE UNIT · Go

runFunc

ktr0731/evans · app/commands.go:40

func runFunc(
	flags *flags,
	f func(cmd *cobra.Command, cfg *mergedConfig) error,
) func(cmd *cobra.Command, args []string) error {
	return func(cmd *cobra.Command, args []string) error {
		if err := flags.validate(); err != nil {
			return errors.Wrap(err, "invalid flag condition")
		}

		if flags.meta.verbose {
			logger.SetOutput(os.Stderr)
		}

		switch {
		case flags.meta.edit:
			if err := config.Edit(); err != nil {
				return errors.Wrap(err, "failed to edit the project local config file")
			}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…