Fix variables in recipes, prefix expansion, and -a switch behavior

This commit is contained in:
Daniel Jones 2013-03-18 20:37:01 -07:00
parent 82ec5bfab4
commit 913af90c60
5 changed files with 15 additions and 6 deletions

View file

@ -46,15 +46,19 @@ func stripIndentation(s string, mincol int) string {
func printIndented(out io.Writer, s string, ind int) {
indentation := strings.Repeat(" ", ind)
reader := bufio.NewReader(strings.NewReader(s))
firstline := true
for {
line, err := reader.ReadString('\n')
if len(line) > 0 {
io.WriteString(out, indentation)
if !firstline {
io.WriteString(out, indentation)
}
io.WriteString(out, line)
}
if err != nil {
break
}
firstline = false
}
}