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

Function printRawView

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

Source from the content-addressed store, hash-verified

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