MCPcopy Index your code
hub / github.com/cloudfoundry/cli / displayTargetTable

Method displayTargetTable

command/v7/target_command.go:149–168  ·  view source on GitHub ↗

displayTargetTable neatly displays target information.

(user configv3.User)

Source from the content-addressed store, hash-verified

147
148// displayTargetTable neatly displays target information.
149func (cmd *TargetCommand) displayTargetTable(user configv3.User) {
150 table := [][]string{
151 {cmd.UI.TranslateText("API endpoint:"), cmd.Config.Target()},
152 {cmd.UI.TranslateText("API version:"), cmd.Config.APIVersion()},
153 {cmd.UI.TranslateText("user:"), user.Name},
154 }
155
156 if cmd.Config.HasTargetedOrganization() {
157 table = append(table, []string{
158 cmd.UI.TranslateText("org:"), cmd.Config.TargetedOrganization().Name,
159 })
160 }
161
162 if cmd.Config.HasTargetedSpace() {
163 table = append(table, []string{
164 cmd.UI.TranslateText("space:"), cmd.Config.TargetedSpace().Name,
165 })
166 }
167 cmd.UI.DisplayKeyValueTable("", table, 3)
168}

Callers 1

ExecuteMethod · 0.95

Calls 8

TranslateTextMethod · 0.65
TargetMethod · 0.65
APIVersionMethod · 0.65
TargetedOrganizationMethod · 0.65
HasTargetedSpaceMethod · 0.65
TargetedSpaceMethod · 0.65
DisplayKeyValueTableMethod · 0.65

Tested by

no test coverage detected