displayTargetTable neatly displays target information.
(user configv3.User)
| 147 | |
| 148 | // displayTargetTable neatly displays target information. |
| 149 | func (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 | } |
no test coverage detected