1
0
Fork 0
forked from External/ergo

consolidate ArgsToStrings

This commit is contained in:
Shivaram Lingamneni 2020-12-30 00:41:34 -05:00
parent 0c9ecbade7
commit ec375f5bdc
5 changed files with 22 additions and 42 deletions

View file

@ -132,3 +132,14 @@ func (t *TokenLineBuilder) Lines() (result []string) {
}
return
}
// BuildTokenLines is a convenience to apply TokenLineBuilder to a predetermined
// slice of tokens.
func BuildTokenLines(lineLen int, tokens []string, delim string) []string {
var tl TokenLineBuilder
tl.Initialize(lineLen, delim)
for _, arg := range tokens {
tl.Add(arg)
}
return tl.Lines()
}