INNER CODE UNIT · Go

func

ktr0731/evans · app/app.go:34

func (a *App) Run(args []string) int {
	// Currently, Evans is migrating to new-style command-line interface.
	// So, there are both of old-style and new-style command-line interfaces in this version.

	a.cmd.SetArgs(args)
	for _, r := range args {
		// Hack.
		switch r {
		case "cli", "repl": // Sub commands for new-style interface.
			// If an arg named "cli" or "repl" is passed, it is regarded as a sub-command of new-style.
			a.cmd.registerNewCommands()
			a.cmd.RunE = nil
		case "-h", "--help":
			// If the help flags is passed, call registerNewCommands for display sub-command helps.
			a.cmd.registerNewCommands()
		}
	}
	err := a.cmd.Execute()

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…