MCPcopy Create free account
hub / github.com/docopt/docopt.go / handleError

Function handleError

docopt.go:147–152  ·  view source on GitHub ↗
(err error, usage string)

Source from the content-addressed store, hash-verified

145}
146
147func handleError(err error, usage string) string {
148 if _, ok := err.(*UserError); ok {
149 return strings.TrimSpace(fmt.Sprintf("%s\n%s", err, usage))
150 }
151 return ""
152}
153
154func parseSection(name, source string) []string {
155 p := regexp.MustCompile(`(?im)^([^\n]*` + name + `[^\n]*\n?(?:[ \t].*?(?:\n|$))*)`)

Callers 1

parseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected