MCPcopy Create free account
hub / github.com/goadesign/goa / UsageExamples

Function UsageExamples

codegen/cli/cli.go:270–279  ·  view source on GitHub ↗

UsageExamples builds a section template that generates a help text showing a valid invocation of the CLI tool.

(data []*CommandData)

Source from the content-addressed store, hash-verified

268// UsageExamples builds a section template that generates a help text showing
269// a valid invocation of the CLI tool.
270func UsageExamples(data []*CommandData) *codegen.SectionTemplate {
271 var examples []string
272 for i, cmd := range data {
273 if i < 5 {
274 examples = append(examples, cmd.Example)
275 }
276 }
277
278 return &codegen.SectionTemplate{Source: cliTemplates.Read(usageExamplesT), Data: examples}
279}
280
281// FlagsCode returns a string containing the code that parses the command-line
282// flags to infer the command (service), sub-command (method), and the

Callers 2

endpointParserFunction · 0.92
endpointParserFunction · 0.92

Calls 1

ReadMethod · 0.45

Tested by

no test coverage detected