<commit_before>package securitygroup

import (
	"github.com/cloudfoundry/cli/cf/api/security_groups/defaults/staging"
	"github.com/cloudfoundry/cli/cf/command_metadata"
	"github.com/cloudfoundry/cli/cf/configuration"
	"github.com/cloudfoundry/cli/cf/requirements"
	"github.com/cloudfoundry/cli/cf/terminal"
	"github.com/codegangsta/cli"
)

type listDefaultStagingSecurityGroups struct {
	ui                       terminal.UI
	stagingSecurityGroupRepo staging.StagingSecurityGroupsRepo
	configRepo               configuration.Reader
}

func NewListDefaultStagingSecurityGroups(ui terminal.UI, configRepo configuration.Reader, stagingSecurityGroupRepo staging.StagingSecurityGroupsRepo) listDefaultStagingSecurityGroups {
	return listDefaultStagingSecurityGroups{
		ui:                       ui,
		configRepo:               configRepo,
		stagingSecurityGroupRepo: stagingSecurityGroupRepo,
	}
}

func (cmd listDefaultStagingSecurityGroups) Metadata() command_metadata.CommandMetadata {
	return command_metadata.CommandMetadata{
		Name:        "default-staging-security-groups",
		Description: "List security groups in the set of default security groups for staging applications.",
		Usage:       "CF_NAME default-security-staging-groups",
	}
}

func (cmd listDefaultStagingSecurityGroups) GetRequirements(requirementsFactory requirements.Factory, context *cli.Context) ([]requirements.Requirement, error) {
	if len(context.Args()) != 0 {
		cmd.ui.FailWithUsage(context)
	}

	requirements := []requirements.Requirement{requirementsFactory.NewLoginRequirement()}
	return requirements, nil
}

func (cmd listDefaultStagingSecurityGroups) Run(context *cli.Context) {
	cmd.ui.Say("Acquiring default security groups as '%s'", terminal.EntityNameColor(cmd.configRepo.Username()))

	defaultSecurityGroupsFields, err := cmd.stagingSecurityGroupRepo.List()
	if err != nil {
		cmd.ui.Failed(err.Error())
	}

	cmd.ui.Ok()
	cmd.ui.Say("")

	if len(defaultSecurityGroupsFields) > 0 {
		for _, value := range defaultSecurityGroupsFields {<commit_msg>Tweak help text to be more correcter<commit_after>package securitygroup

import (
	"github.com/cloudfoundry/cli/cf/api/security_groups/defaults/staging"
	"github.com/cloudfoundry/cli/cf/command_metadata"
	"github.com/cloudfoundry/cli/cf/configuration"
	"github.com/cloudfoundry/cli/cf/requirements"
	"github.com/cloudfoundry/cli/cf/terminal"
	"github.com/codegangsta/cli"
)

type listDefaultStagingSecurityGroups struct {
	ui                       terminal.UI
	stagingSecurityGroupRepo staging.StagingSecurityGroupsRepo
	configRepo               configuration.Reader
}

func NewListDefaultStagingSecurityGroups(ui terminal.UI, configRepo configuration.Reader, stagingSecurityGroupRepo staging.StagingSecurityGroupsRepo) listDefaultStagingSecurityGroups {
	return listDefaultStagingSecurityGroups{
		ui:                       ui,
		configRepo:               configRepo,
		stagingSecurityGroupRepo: stagingSecurityGroupRepo,
	}
}

func (cmd listDefaultStagingSecurityGroups) Metadata() command_metadata.CommandMetadata {
	return command_metadata.CommandMetadata{
		Name:        "default-staging-security-groups",
		Description: "List security groups in the set of default security groups for staging applications.",
		Usage:       "CF_NAME default-staging-security-groups",
	}
}

func (cmd listDefaultStagingSecurityGroups) GetRequirements(requirementsFactory requirements.Factory, context *cli.Context) ([]requirements.Requirement, error) {
	if len(context.Args()) != 0 {
		cmd.ui.FailWithUsage(context)
	}

	requirements := []requirements.Requirement{requirementsFactory.NewLoginRequirement()}
	return requirements, nil
}

func (cmd listDefaultStagingSecurityGroups) Run(context *cli.Context) {
	cmd.ui.Say("Acquiring default security groups as '%s'", terminal.EntityNameColor(cmd.configRepo.Username()))

	defaultSecurityGroupsFields, err := cmd.stagingSecurityGroupRepo.List()
	if err != nil {
		cmd.ui.Failed(err.Error())
	}

	cmd.ui.Ok()
	cmd.ui.Say("")

	if len(defaultSecurityGroupsFields) > 0 {
		for _, value := range defaultSecurityGroupsFields {
{'fraction_non_alphanumeric': 0.09738194274528994, 'fraction_numerical': 0.0009787129924149743, 'mean_word_length': 5.002936857562408, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3520507', 'n_tokens_mistral': 1207, 'n_tokens_neox': 1184, 'n_words': 218}