displayName formats the codespace name for the interactive selector prompt.
(includeOwner bool)
| 192 | |
| 193 | // displayName formats the codespace name for the interactive selector prompt. |
| 194 | func (c codespace) displayName(includeOwner bool) string { |
| 195 | branch := c.branchWithGitStatus() |
| 196 | displayName := c.DisplayName |
| 197 | |
| 198 | if displayName == "" { |
| 199 | displayName = c.Name |
| 200 | } |
| 201 | |
| 202 | description := fmt.Sprintf("%s [%s]: %s", c.Repository.FullName, branch, displayName) |
| 203 | |
| 204 | if includeOwner { |
| 205 | description = fmt.Sprintf("%-15s %s", c.Owner.Login, description) |
| 206 | } |
| 207 | |
| 208 | return description |
| 209 | } |
| 210 | |
| 211 | // gitStatusDirty represents an unsaved changes status. |
| 212 | const gitStatusDirty = "*" |