code: func (cfg *Config) Main(c context.Context, argv []string, env environ.Env) int {
  	if len(argv) == 0 {
  		panic("zero-length argument slice")
  	}
  
  	// Implementation of "checkWrapper": if CheckWrapperENV is set, we immediately
  	// exit with a non-zero value.
  	if wrapperCheck(env) {
  		return 1
  	}
  
  	defaultLogLevel := logging.Error
  	if env.GetEmpty(LogTraceENV) != "" {
  		defaultLogLevel = logging.Debug
  	}
  
  	c = gologger.StdConfig.Use(c)
  	c = logging.SetLevel(c, defaultLogLevel)
  
  	a := application{
  		Config: cfg,
  		opts: vpython.Options{
  			EnvConfig: venv.Config{
  				BaseDir:           "", // (Determined below).
  				MaxHashLen:        6,
  				SetupEnv:          env,
  				Package:           cfg.VENVPackage,
  				PruneThreshold:    cfg.PruneThreshold,
  				MaxPrunesPerSweep: cfg.MaxPrunesPerSweep,
  				Loader:            cfg.PackageLoader,
  			},
  			BaseWheels: cfg.BaseWheels,
  			WaitForEnv: true,
  			SpecLoader: cfg.SpecLoader,
  			Environ:    env,
  		},
  		logConfig: logging.Config{
  			Level: defaultLogLevel,
  		},
  	}
  
  	return run(c, func(c context.Context) error {
  		return a.mainImpl(c, argv[0], argv[1:])
  	})
  }
docs: // Main is the main application entry point.