|
5 | 5 | "net/http" |
6 | 6 | "strings" |
7 | 7 | "time" |
8 | | - "unicode" |
9 | 8 |
|
10 | 9 | "github.com/cli/cli/api" |
11 | 10 | "github.com/cli/cli/internal/ghinstance" |
@@ -153,13 +152,13 @@ func listRun(opts *ListOptions) error { |
153 | 152 |
|
154 | 153 | if tp.IsTTY() { |
155 | 154 | tp.AddField(nameWithOwner, nil, cs.Bold) |
156 | | - tp.AddField(info, nil, infoColor) |
157 | 155 | tp.AddField(text.ReplaceExcessiveWhitespace(description), nil, nil) |
| 156 | + tp.AddField(info, nil, infoColor) |
158 | 157 | tp.AddField(utils.FuzzyAgoAbbr(now, repo.UpdatedAt), nil, nil) |
159 | 158 | } else { |
160 | 159 | tp.AddField(nameWithOwner, nil, nil) |
161 | | - tp.AddField(visibility, nil, nil) |
162 | 160 | tp.AddField(text.ReplaceExcessiveWhitespace(description), nil, nil) |
| 161 | + tp.AddField(visibility, nil, nil) |
163 | 162 | tp.AddField(updatedAt, nil, nil) |
164 | 163 | } |
165 | 164 | tp.EndRow() |
@@ -196,22 +195,21 @@ type Repository struct { |
196 | 195 |
|
197 | 196 | func (r Repository) Info() string { |
198 | 197 | var info string |
| 198 | + var tags []string |
199 | 199 |
|
200 | 200 | if r.IsPrivate { |
201 | | - info = "private" |
| 201 | + tags = append(tags, "private") |
202 | 202 | } |
203 | 203 | if r.IsFork { |
204 | | - info += " fork" |
| 204 | + tags = append(tags, "fork") |
205 | 205 | } |
206 | 206 | if r.IsArchived { |
207 | | - info += " archived" |
| 207 | + tags = append(tags, "archived") |
208 | 208 | } |
209 | 209 |
|
210 | | - if info != "" { |
211 | | - info = strings.TrimPrefix(info, " ") |
212 | | - infoRunes := []rune(info) |
213 | | - infoRunes[0] = unicode.ToUpper(infoRunes[0]) |
214 | | - info = fmt.Sprintf("(%s)", string(infoRunes)) |
| 210 | + if len(tags) > 0 { |
| 211 | + tags[0] = strings.Title(tags[0]) |
| 212 | + info = strings.Join(tags, ", ") |
215 | 213 | } |
216 | 214 |
|
217 | 215 | return info |
|
0 commit comments