MCPcopy
hub / github.com/cli/cli / printJSONFields

Function printJSONFields

internal/docs/markdown.go:18–27  ·  view source on GitHub ↗
(w io.Writer, cmd *cobra.Command)

Source from the content-addressed store, hash-verified

16)
17
18func printJSONFields(w io.Writer, cmd *cobra.Command) {
19 raw, ok := cmd.Annotations["help:json-fields"]
20 if !ok {
21 return
22 }
23
24 fmt.Fprint(w, "### JSON Fields\n\n")
25 fmt.Fprint(w, text.FormatSlice(strings.Split(raw, ","), 0, 0, "`", "`", true))
26 fmt.Fprint(w, "\n\n")
27}
28
29func printAliases(w io.Writer, cmd *cobra.Command) {
30 if len(cmd.Aliases) > 0 {

Callers 1

genMarkdownCustomFunction · 0.85

Calls 1

FormatSliceFunction · 0.92

Tested by

no test coverage detected