From 97107661feb955f9481fa3d21423fde1ba353658 Mon Sep 17 00:00:00 2001 From: vilmibm Date: Tue, 14 Jul 2020 12:05:59 -0500 Subject: [PATCH] review feedback --- command/issue.go | 8 ++++---- command/issue_test.go | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/command/issue.go b/command/issue.go index 720d81669..6a1f6db3a 100644 --- a/command/issue.go +++ b/command/issue.go @@ -315,8 +315,8 @@ func printRawIssuePreview(out io.Writer, issue *api.Issue) error { labels := issueLabelList(*issue) projects := issueProjectList(*issue) - // Print empty strings for empty values so the number of metadata lines is always consistent (ie - // so head -n8 can be relied on) + // Print empty strings for empty values so the number of metadata lines is consistent when + // processing many issues with head and grep. fmt.Fprintf(out, "title:\t%s\n", issue.Title) fmt.Fprintf(out, "state:\t%s\n", issue.State) fmt.Fprintf(out, "author:\t%s\n", issue.Author.Login) @@ -490,7 +490,7 @@ func issueCreate(cmd *cobra.Command, args []string) error { interactive := !(cmd.Flags().Changed("title") && cmd.Flags().Changed("body")) if interactive && !connectedToTerminal(cmd) { - return fmt.Errorf("can't run non-interactively without both --title and --body") + return fmt.Errorf("must provide --title and --body when not attached to a terminal") } if interactive { @@ -662,7 +662,7 @@ func printIssues(w io.Writer, prefix string, totalCount int, issues []api.Issue) if table.IsTTY() { table.AddField(utils.FuzzyAgo(ago), nil, utils.Gray) } else { - table.AddField(fmt.Sprintf("%d", int(ago.Minutes())), nil, nil) + table.AddField(issue.UpdatedAt.String(), nil, nil) } table.EndRow() } diff --git a/command/issue_test.go b/command/issue_test.go index 7ed580c90..68f979171 100644 --- a/command/issue_test.go +++ b/command/issue_test.go @@ -568,7 +568,7 @@ func TestIssueCreate_nontty_error(t *testing.T) { t.Fatal("expected error running command `issue create`") } - assert.Equal(t, "can't run non-interactively without both --title and --body", err.Error()) + assert.Equal(t, "must provide --title and --body when not attached to a terminal", err.Error()) }