code: func (actor Actor) MergeAndValidateSettingsAndManifests(cmdLineSettings CommandLineSettings, apps []manifest.Application) ([]manifest.Application, error) {
  	var mergedApps []manifest.Application
  
  	if len(apps) == 0 {
  		log.Info("no manifest, generating one from command line settings")
  		mergedApps = append(mergedApps, cmdLineSettings.OverrideManifestSettings(manifest.Application{}))
  	} else {
  		if cmdLineSettings.Name != "" && len(apps) > 1 {
  			var err error
  			apps, err = actor.selectApp(cmdLineSettings.Name, apps)
  			if err != nil {
  				return nil, err
  			}
  		}
  		err := actor.validateCommandLineSettingsAndManifestCombinations(cmdLineSettings, apps)
  		if err != nil {
  			return nil, err
  		}
  
  		for _, app := range apps {
  			mergedApps = append(mergedApps, cmdLineSettings.OverrideManifestSettings(app))
  		}
  	}
  
  	mergedApps, err := actor.sanitizeAppPath(mergedApps)
  	if err != nil {
  		return nil, err
  	}
  	mergedApps = actor.setSaneEndpoint(mergedApps)
  
  	log.Debugf("merged app settings: %#v", mergedApps)
  
  	err = actor.validateMergedSettings(mergedApps)
  	if err != nil {
  		log.Errorln("validation error post merge:", err)
  		return nil, err
  	}
  	return mergedApps, nil
  }
docs: // MergeAndValidateSettingsAndManifests merges command line settings and
  // manifest settings. It does this by:
  // - Validating command line setting and their effect on the provided manifests
  // - Override manifest settings with command line settings (when applicable)
  // - Sanitizing the inputs
  // - Validate merged manifest