INNER CODE UNIT · Go

newOldCommand

ktr0731/evans · app/commands.go:98

func newOldCommand(flags *flags, ui cui.UI) *command {
	cmd := &cobra.Command{
		Use: "evans [global options ...] <command>",
		RunE: runFunc(flags, func(cmd *cobra.Command, cfg *mergedConfig) (err error) {
			if cfg.REPL.ColoredOutput {
				ui = cui.NewColored(ui)
			}

			defer func() {
				if err == nil {
					ui.Warn("evans: deprecated usage, please use sub-commands. see `evans -h` for more details.")
				}
			}()

			isCLIMode := cfg.cli || mode.IsCLIMode(cfg.file)
			if cfg.repl || !isCLIMode {
				return runREPLCommand(cfg, ui)
			}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…