forked from External/ergo
consolidate ArgsToStrings
This commit is contained in:
parent
0c9ecbade7
commit
ec375f5bdc
5 changed files with 22 additions and 42 deletions
|
|
@ -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()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue