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