Skip to content

Commit 9710766

Browse files
committed
review feedback
1 parent 36ade42 commit 9710766

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

command/issue.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,8 @@ func printRawIssuePreview(out io.Writer, issue *api.Issue) error {
315315
labels := issueLabelList(*issue)
316316
projects := issueProjectList(*issue)
317317

318-
// Print empty strings for empty values so the number of metadata lines is always consistent (ie
319-
// so head -n8 can be relied on)
318+
// Print empty strings for empty values so the number of metadata lines is consistent when
319+
// processing many issues with head and grep.
320320
fmt.Fprintf(out, "title:\t%s\n", issue.Title)
321321
fmt.Fprintf(out, "state:\t%s\n", issue.State)
322322
fmt.Fprintf(out, "author:\t%s\n", issue.Author.Login)
@@ -490,7 +490,7 @@ func issueCreate(cmd *cobra.Command, args []string) error {
490490
interactive := !(cmd.Flags().Changed("title") && cmd.Flags().Changed("body"))
491491

492492
if interactive && !connectedToTerminal(cmd) {
493-
return fmt.Errorf("can't run non-interactively without both --title and --body")
493+
return fmt.Errorf("must provide --title and --body when not attached to a terminal")
494494
}
495495

496496
if interactive {
@@ -662,7 +662,7 @@ func printIssues(w io.Writer, prefix string, totalCount int, issues []api.Issue)
662662
if table.IsTTY() {
663663
table.AddField(utils.FuzzyAgo(ago), nil, utils.Gray)
664664
} else {
665-
table.AddField(fmt.Sprintf("%d", int(ago.Minutes())), nil, nil)
665+
table.AddField(issue.UpdatedAt.String(), nil, nil)
666666
}
667667
table.EndRow()
668668
}

command/issue_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ func TestIssueCreate_nontty_error(t *testing.T) {
568568
t.Fatal("expected error running command `issue create`")
569569
}
570570

571-
assert.Equal(t, "can't run non-interactively without both --title and --body", err.Error())
571+
assert.Equal(t, "must provide --title and --body when not attached to a terminal", err.Error())
572572

573573
}
574574

0 commit comments

Comments
 (0)