commands/export_config.go
func (c *ExportConfigurationCommand) Execute([]string) error {
	if cfMgmt, err := InitializeManagers(c.BaseCFConfigCommand); err != nil {
		lo.G.Errorf("Unable to initialize cf-mgmt. Error : %s", err)
		return err
	} else {
		exportManager := export.NewExportManager(c.ConfigDirectory,
			cfMgmt.UAAManager,
			cfMgmt.SpaceManager,
			cfMgmt.UserManager,
			cfMgmt.OrgManager,
			cfMgmt.SecurityGroupManager,
			cfMgmt.IsolationSegmentManager,
			cfMgmt.PrivateDomainManager,
			cfMgmt.SharedDomainManager,
			cfMgmt.ServiceAccessManager,
		  cfMgmt.QuotaManager)
		excludedOrgs := make(map[string]string)
		for _, org := range config.DefaultProtectedOrgs {
			excludedOrgs[org] = org
		}
		for _, org := range c.ExcludedOrgs {
			excludedOrgs[org] = org
		}
		excludedSpaces := make(map[string]string)
		for _, space := range c.ExcludedSpaces {
			excludedSpaces[space] = space
		}
		lo.G.Infof("Orgs excluded from export by default: %v ", config.DefaultProtectedOrgs)
		lo.G.Infof("Orgs excluded from export by user:  %v ", c.ExcludedOrgs)
		lo.G.Infof("Spaces excluded from export by user:  %v ", c.ExcludedSpaces)
		err = exportManager.ExportConfig(excludedOrgs, excludedSpaces)
		if err != nil {
			lo.G.Errorf("Export failed with error:  %s", err)
			return err
		}
	}
	return nil
}
func (c *ExportConfigurationCommand) Execute([]string) error {
	if cfMgmt, err := InitializeManagers(c.BaseCFConfigCommand); err != nil {
		lo.G.Errorf("Unable to initialize cf-mgmt. Error : %s", err)
		return err
	} else {
		exportManager := export.NewExportManager(c.ConfigDirectory,
			cfMgmt.UAAManager,
			cfMgmt.SpaceManager,
			cfMgmt.UserManager,
			cfMgmt.OrgManager,
			cfMgmt.SecurityGroupManager,
			cfMgmt.IsolationSegmentManager,
			cfMgmt.PrivateDomainManager,
			cfMgmt.SharedDomainManager,
			cfMgmt.ServiceAccessManager,
		  cfMgmt.QuotaManager)
		excludedOrgs := make(map[string]string)
		for _, org := range config.DefaultProtectedOrgs {
			excludedOrgs[org] = org
		}
		for _, org := range c.ExcludedOrgs {
			excludedOrgs[org] = org
		}
		excludedSpaces := make(map[string]string)
		for _, space := range c.ExcludedSpaces {
			excludedSpaces[space] = space
		}
		lo.G.Infof("Orgs excluded from export by default: %v ", config.DefaultProtectedOrgs)
		lo.G.Infof("Orgs excluded from export by user:  %v ", c.ExcludedOrgs)
		lo.G.Infof("Spaces excluded from export by user:  %v ", c.ExcludedSpaces)
		err = exportManager.ExportConfig(excludedOrgs, excludedSpaces)
		if err != nil {
			lo.G.Errorf("Export failed with error:  %s", err)
			return err
		}
	}
	return nil
}
//Execute - initializes cf-mgmt configuration