code: func (c *Config) SaveProfile(profileAliasHost, profileDir string, profileOptions ...ProfileOptions) error {
  	if c.WebProxyAddr == "" {
  		return nil
  	}
  
  	// The profile is saved to a directory with the name of the proxy web endpoint.
  	webProxyHost, _ := c.WebProxyHostPort()
  	profileDir = FullProfilePath(profileDir)
  	profilePath := path.Join(profileDir, webProxyHost) + ".yaml"
  
  	profileAliasPath := ""
  	if profileAliasHost != "" {
  		profileAliasPath = path.Join(profileDir, profileAliasHost) + ".yaml"
  	}
  
  	var cp ClientProfile
  	cp.Username = c.Username
  	cp.WebProxyAddr = c.WebProxyAddr
  	cp.SSHProxyAddr = c.SSHProxyAddr
  	cp.KubeProxyAddr = c.KubeProxyAddr
  	cp.ForwardedPorts = c.LocalForwardPorts.String()
  	cp.SiteName = c.SiteName
  
  	// create a profile file and set it current base on the option
  	var opts ProfileOptions
  	if len(profileOptions) == 0 {
  		// default behavior is to override the profile
  		opts = ProfileMakeCurrent
  	} else {
  		for _, flag := range profileOptions {
  			opts |= flag
  		}
  	}
  	if err := cp.SaveTo(ProfileLocation{
  		AliasPath: profileAliasPath,
  		Path:      profilePath,
  		Options:   opts,
  	}); err != nil {
  		return trace.Wrap(err)
  	}
  	return nil
  }
docs: // SaveProfile updates the given profiles directory with the current configuration
  // If profileDir is an empty string, the default ~/.tsh is used