func main()

in tool/cmd/main.go [150:184]


func main() {
	if len(os.Args) < 2 {
		printUsage()
		os.Exit(0)
	}

	err := initEnv()
	if err != nil {
		fatal(err)
	}

	subcmd := os.Args[1]
	switch subcmd {
	case SubcommandVersion:
		err = config.PrintVersion()
	case SubcommandSet:
		err = config.Configure()
	case SubcommandGo:
		err = preprocess.Preprocess()
	case SubcommandRemix:
		err = instrument.Instrument()
	default:
		printUsage()
	}
	if err != nil {
		if subcmd != SubcommandRemix {
			fatal(err)
		} else {
			// If error occurs in remix phase, we dont want to decoret the error
			// message with the environments, just print the error message, the
			// caller(preprocess) phase will decorate instead.
			util.LogFatal(err.Error())
		}
	}
}