"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "pkg/cmd/issue/view/view.go" between
gh-cli-1.12.1.tar.gz and gh-cli-1.13.1.tar.gz

About: GitHub CLI is GitHub’s official command line tool.

view.go  (gh-cli-1.12.1):view.go  (gh-cli-1.13.1)
skipping to change at line 128 skipping to change at line 128
if opts.IO.IsStdoutTTY() { if opts.IO.IsStdoutTTY() {
return printHumanIssuePreview(opts, issue) return printHumanIssuePreview(opts, issue)
} }
if opts.Comments { if opts.Comments {
fmt.Fprint(opts.IO.Out, prShared.RawCommentList(issue.Comments, a pi.PullRequestReviews{})) fmt.Fprint(opts.IO.Out, prShared.RawCommentList(issue.Comments, a pi.PullRequestReviews{}))
return nil return nil
} }
return printRawIssuePreview(opts.IO.Out, issue) return printRawIssuePreview(opts.IO.Out, issue, opts.IO.ColorScheme())
} }
func findIssue(client *http.Client, baseRepoFn func() (ghrepo.Interface, error), selector string, loadComments bool) (*api.Issue, error) { func findIssue(client *http.Client, baseRepoFn func() (ghrepo.Interface, error), selector string, loadComments bool) (*api.Issue, error) {
apiClient := api.NewClientFromHTTP(client) apiClient := api.NewClientFromHTTP(client)
issue, repo, err := issueShared.IssueFromArg(apiClient, baseRepoFn, selec tor) issue, repo, err := issueShared.IssueFromArg(apiClient, baseRepoFn, selec tor)
if err != nil { if err != nil {
return issue, err return issue, err
} }
if loadComments { if loadComments {
err = preloadIssueComments(client, repo, issue) err = preloadIssueComments(client, repo, issue)
} }
return issue, err return issue, err
} }
func printRawIssuePreview(out io.Writer, issue *api.Issue) error { func printRawIssuePreview(out io.Writer, issue *api.Issue, cs *iostreams.ColorSc heme) error {
assignees := issueAssigneeList(*issue) assignees := issueAssigneeList(*issue)
labels := shared.IssueLabelList(*issue) labels := shared.IssueLabelList(*issue, cs)
projects := issueProjectList(*issue) projects := issueProjectList(*issue)
// Print empty strings for empty values so the number of metadata lines i s consistent when // Print empty strings for empty values so the number of metadata lines i s consistent when
// processing many issues with head and grep. // 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)
fmt.Fprintf(out, "labels:\t%s\n", labels) fmt.Fprintf(out, "labels:\t%s\n", labels)
fmt.Fprintf(out, "comments:\t%d\n", issue.Comments.TotalCount) fmt.Fprintf(out, "comments:\t%d\n", issue.Comments.TotalCount)
fmt.Fprintf(out, "assignees:\t%s\n", assignees) fmt.Fprintf(out, "assignees:\t%s\n", assignees)
skipping to change at line 196 skipping to change at line 196
if reactions := prShared.ReactionGroupList(issue.ReactionGroups); reactio ns != "" { if reactions := prShared.ReactionGroupList(issue.ReactionGroups); reactio ns != "" {
fmt.Fprint(out, reactions) fmt.Fprint(out, reactions)
fmt.Fprintln(out) fmt.Fprintln(out)
} }
// Metadata // Metadata
if assignees := issueAssigneeList(*issue); assignees != "" { if assignees := issueAssigneeList(*issue); assignees != "" {
fmt.Fprint(out, cs.Bold("Assignees: ")) fmt.Fprint(out, cs.Bold("Assignees: "))
fmt.Fprintln(out, assignees) fmt.Fprintln(out, assignees)
} }
if labels := shared.IssueLabelList(*issue); labels != "" { if labels := shared.IssueLabelList(*issue, cs); labels != "" {
fmt.Fprint(out, cs.Bold("Labels: ")) fmt.Fprint(out, cs.Bold("Labels: "))
fmt.Fprintln(out, labels) fmt.Fprintln(out, labels)
} }
if projects := issueProjectList(*issue); projects != "" { if projects := issueProjectList(*issue); projects != "" {
fmt.Fprint(out, cs.Bold("Projects: ")) fmt.Fprint(out, cs.Bold("Projects: "))
fmt.Fprintln(out, projects) fmt.Fprintln(out, projects)
} }
if issue.Milestone != nil { if issue.Milestone != nil {
fmt.Fprint(out, cs.Bold("Milestone: ")) fmt.Fprint(out, cs.Bold("Milestone: "))
fmt.Fprintln(out, issue.Milestone.Title) fmt.Fprintln(out, issue.Milestone.Title)
 End of changes. 4 change blocks. 
4 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)