MCPcopy Create free account
hub / github.com/cockroachdb/cockroachdb-parser / Format

Method Format

pkg/sql/parser/help.go:52–72  ·  view source on GitHub ↗

Format prints out details about the message onto the specified output stream.

(w io.Writer)

Source from the content-addressed store, hash-verified

50
51// Format prints out details about the message onto the specified output stream.
52func (h *HelpMessage) Format(w io.Writer) {
53 if h.Command != "" {
54 fmt.Fprintf(w, "Command: %s\n", h.Command)
55 }
56 if h.Function != "" {
57 fmt.Fprintf(w, "Function: %s\n", h.Function)
58 }
59 if h.ShortDescription != "" {
60 fmt.Fprintf(w, "Description: %s\n", h.ShortDescription)
61 }
62 if h.Category != "" {
63 fmt.Fprintf(w, "Category: %s\n", h.Category)
64 }
65 if h.Command != "" {
66 fmt.Fprintln(w, "Syntax:")
67 }
68 fmt.Fprintln(w, strings.TrimSpace(h.Text))
69 if h.SeeAlso != "" {
70 fmt.Fprintf(w, "\nSee also:\n %s\n", h.SeeAlso)
71 }
72}
73
74// helpWith is to be used in parser actions to mark the parser "in
75// error", with the error set to a contextual help message about the

Callers 1

StringMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected