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

Method String

docopt.go:1068–1084  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1066}
1067
1068func (p *pattern) String() string {
1069 if p.t&patternOption != 0 {
1070 return fmt.Sprintf("%s(%s, %s, %d, %+v)", p.t, p.short, p.long, p.argcount, p.value)
1071 } else if p.t&patternLeaf != 0 {
1072 return fmt.Sprintf("%s(%s, %+v)", p.t, p.name, p.value)
1073 } else if p.t&patternBranch != 0 {
1074 result := ""
1075 for i, child := range p.children {
1076 if i > 0 {
1077 result += ", "
1078 }
1079 result += child.String()
1080 }
1081 return fmt.Sprintf("%s(%s)", p.t, result)
1082 }
1083 panic("unmatched type")
1084}
1085
1086func (p *pattern) transform() *pattern {
1087 /*

Callers

nothing calls this directly

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected