code: func (vr *validateRun) validateExisting(ctx context.Context, dir string) (*validateResult, error) {
  	switch {
  	case vr.configSet == "":
  		return nil, base.MissingFlagError("-config-set")
  	case vr.Meta.ConfigServiceHost == "":
  		return nil, base.MissingFlagError("-config-service-host")
  	case vr.Meta.WasTouched("config_dir"):
  		return nil, base.NewCLIError("-config-dir shouldn't be used, the directory was already given as positional argument")
  	}
  	configSet, err := lucicfg.ReadConfigSet(dir, vr.configSet)
  	if err != nil {
  		return nil, err
  	}
  	res, err := base.ValidateOutput(
  		ctx,
  		lucicfg.Output{
  			Data:  configSet.Data,
  			Roots: map[string]string{configSet.Name: "."},
  		},
  		vr.ConfigService,
  		vr.Meta.ConfigServiceHost,
  		vr.Meta.FailOnWarnings)
  	return &validateResult{Validation: res}, err
  }
docs: // validateExisting validates an existing config set on disk, whatever it may
  // be.
  //
  // Verifies -config-set flag was used, since it is the only way to provide the
  // name of the config set to verify against in this case.
  //
  // Also verifies -config-dir is NOT used, since it is redundant: the directory
  // is passed through the positional arguments.