code: func (m *Main) ParseFlags(args []string) error {
  	if s := os.Getenv("FLYNN_REDIS"); s != "" {
  		m.ServiceName = s
  	}
  
  	if port := os.Getenv("PORT"); port != "" {
  		m.Addr = ":" + port
  	}
  	m.Handler.RedisImageID = os.Getenv("REDIS_IMAGE_ID")
  
  	// Connect to controller.
  	client, err := controller.NewClient("", os.Getenv("CONTROLLER_KEY"))
  	if err != nil {
  		m.Logger.Error("cannot connect to controller", "err", err)
  		return err
  	}
  	m.Handler.ServiceName = m.ServiceName
  	m.Handler.ControllerClient = client
  
  	return nil
  }
docs: // ParseFlags parses the command line flags and environment variables.