review feedback
This commit is contained in:
parent
36ade42ba3
commit
97107661fe
2 changed files with 5 additions and 5 deletions
|
|
@ -315,8 +315,8 @@ func printRawIssuePreview(out io.Writer, issue *api.Issue) error {
|
||||||
labels := issueLabelList(*issue)
|
labels := issueLabelList(*issue)
|
||||||
projects := issueProjectList(*issue)
|
projects := issueProjectList(*issue)
|
||||||
|
|
||||||
// Print empty strings for empty values so the number of metadata lines is always consistent (ie
|
// Print empty strings for empty values so the number of metadata lines is consistent when
|
||||||
// so head -n8 can be relied on)
|
// processing many issues with head and grep.
|
||||||
fmt.Fprintf(out, "title:\t%s\n", issue.Title)
|
fmt.Fprintf(out, "title:\t%s\n", issue.Title)
|
||||||
fmt.Fprintf(out, "state:\t%s\n", issue.State)
|
fmt.Fprintf(out, "state:\t%s\n", issue.State)
|
||||||
fmt.Fprintf(out, "author:\t%s\n", issue.Author.Login)
|
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"))
|
interactive := !(cmd.Flags().Changed("title") && cmd.Flags().Changed("body"))
|
||||||
|
|
||||||
if interactive && !connectedToTerminal(cmd) {
|
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 {
|
if interactive {
|
||||||
|
|
@ -662,7 +662,7 @@ func printIssues(w io.Writer, prefix string, totalCount int, issues []api.Issue)
|
||||||
if table.IsTTY() {
|
if table.IsTTY() {
|
||||||
table.AddField(utils.FuzzyAgo(ago), nil, utils.Gray)
|
table.AddField(utils.FuzzyAgo(ago), nil, utils.Gray)
|
||||||
} else {
|
} else {
|
||||||
table.AddField(fmt.Sprintf("%d", int(ago.Minutes())), nil, nil)
|
table.AddField(issue.UpdatedAt.String(), nil, nil)
|
||||||
}
|
}
|
||||||
table.EndRow()
|
table.EndRow()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -568,7 +568,7 @@ func TestIssueCreate_nontty_error(t *testing.T) {
|
||||||
t.Fatal("expected error running command `issue create`")
|
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())
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue