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

Function extras

docopt.go:541–557  ·  view source on GitHub ↗
(help bool, version string, options patternList, doc string)

Source from the content-addressed store, hash-verified

539}
540
541func extras(help bool, version string, options patternList, doc string) string {
542 if help {
543 for _, o := range options {
544 if (o.name == "-h" || o.name == "--help") && o.value == true {
545 return strings.Trim(doc, "\n")
546 }
547 }
548 }
549 if version != "" {
550 for _, o := range options {
551 if (o.name == "--version") && o.value == true {
552 return version
553 }
554 }
555 }
556 return ""
557}
558
559type errorType int
560

Callers 1

parseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected