fix multiline

This commit is contained in:
Michael Yang
2024-04-24 19:17:26 -07:00
parent abe614c705
commit 8907bf51d2
2 changed files with 53 additions and 26 deletions

View File

@@ -110,11 +110,16 @@ func Parse(r io.Reader) (cmds []Command, err error) {
case stateComment, stateNil:
// pass; nothing to flush
case stateValue:
if _, ok := unquote(b.String()); !ok {
s, ok := unquote(b.String())
if !ok {
return nil, io.ErrUnexpectedEOF
}
cmd.Args = b.String()
if role != "" {
s = role + ": " + s
}
cmd.Args = s
cmds = append(cmds, cmd)
default:
return nil, io.ErrUnexpectedEOF