mirror of
https://gitea.com/gitea/tea.git
synced 2026-10-26 11:01:25 +01:00
fix: address verified review findings (terminal-output-1)
Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
25 files changed
+175
-24
No files matched your search
@@ -203,7 +203,7 @@ func commentView(t target, now time.Time) func(services.Comment) terminal.View {
|
||||
Fields: []terminal.Field{
|
||||
{Label: "ID", Value: strconv.FormatInt(comment.ID, 10), PipedOnly: true},
|
||||
{Label: "Author", Value: comment.Author, PipedOnly: true},
|
||||
{Label: "Created_at", Value: comment.CreatedAt, PipedOnly: true},
|
||||
{Label: "Created_at", Value: pipedTime(comment.CreatedAt), PipedOnly: true},
|
||||
},
|
||||
Body: comment.Body, Kind: "comment", URL: comment.URL,
|
||||
}
|
||||
@@ -228,7 +228,7 @@ func (a *application) writeComments(cmd *cobra.Command, t target, n int64, items
|
||||
var text strings.Builder
|
||||
for i, comment := range items {
|
||||
if !d.TTY {
|
||||
text.WriteString(fmt.Sprintf("id:\t%d\nauthor:\t%s\ncreated_at:\t%s\nurl:\t%s\n--\n", comment.ID, terminal.SafeLine(comment.Author), comment.CreatedAt, terminal.SafeLine(comment.URL)))
|
||||
text.WriteString(fmt.Sprintf("id:\t%d\nauthor:\t%s\ncreated_at:\t%s\nurl:\t%s\n--\n", comment.ID, terminal.SafeLine(comment.Author), pipedTime(comment.CreatedAt), terminal.SafeLine(comment.URL)))
|
||||
text.WriteString(strings.TrimRight(terminal.SafeText(comment.Body), "\n") + "\n--\n")
|
||||
continue
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user