MCPcopy Create free account
hub / github.com/cli/cli / printRawView

Function printRawView

pkg/cmd/discussion/view/view.go:460–477  ·  view source on GitHub ↗
(out io.Writer, d *client.Discussion)

Source from the content-addressed store, hash-verified

458}
459
460func printRawView(out io.Writer, d *client.Discussion) error {
461 fmt.Fprintf(out, "title:\t%s\n", d.Title)
462 state := "OPEN"
463 if d.Closed {
464 state = "CLOSED"
465 }
466 fmt.Fprintf(out, "state:\t%s\n", state)
467 fmt.Fprintf(out, "category:\t%s\n", d.Category.Name)
468 fmt.Fprintf(out, "author:\t%s\n", d.Author.Login)
469 fmt.Fprintf(out, "labels:\t%s\n", labelList(d.Labels, nil))
470 fmt.Fprintf(out, "comments:\t%d\n", d.Comments.TotalCount)
471 fmt.Fprintf(out, "number:\t%d\n", d.Number)
472 fmt.Fprintf(out, "url:\t%s\n", d.URL)
473 fmt.Fprintln(out, "--")
474 fmt.Fprintln(out, d.Body)
475
476 return nil
477}
478
479// printRawComments writes the comments as a sequence of metadata blocks,
480// without any discussion-level fields or nested replies. Comments are

Callers 1

viewRunFunction · 0.85

Calls 1

labelListFunction · 0.85

Tested by

no test coverage detected