Tweaks to output.
This commit is contained in:
parent
1ab6af4d3c
commit
82ec5bfab4
2 changed files with 3 additions and 7 deletions
4
mk.go
4
mk.go
|
|
@ -200,11 +200,11 @@ func mkPrintRecipe(target string, recipe string) {
|
||||||
if nocolor {
|
if nocolor {
|
||||||
fmt.Printf("%s: ", target)
|
fmt.Printf("%s: ", target)
|
||||||
} else {
|
} else {
|
||||||
fmt.Printf("%s%s%s → %s",
|
fmt.Printf("%s%s%s →\n%s",
|
||||||
ansiTermBlue+ansiTermBright+ansiTermUnderline, target,
|
ansiTermBlue+ansiTermBright+ansiTermUnderline, target,
|
||||||
ansiTermDefault, ansiTermBlue)
|
ansiTermDefault, ansiTermBlue)
|
||||||
}
|
}
|
||||||
printIndented(os.Stdout, recipe, len(target)+3)
|
printIndented(os.Stdout, recipe, 4)
|
||||||
if len(recipe) == 0 {
|
if len(recipe) == 0 {
|
||||||
os.Stdout.WriteString("\n")
|
os.Stdout.WriteString("\n")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -46,19 +46,15 @@ func stripIndentation(s string, mincol int) string {
|
||||||
func printIndented(out io.Writer, s string, ind int) {
|
func printIndented(out io.Writer, s string, ind int) {
|
||||||
indentation := strings.Repeat(" ", ind)
|
indentation := strings.Repeat(" ", ind)
|
||||||
reader := bufio.NewReader(strings.NewReader(s))
|
reader := bufio.NewReader(strings.NewReader(s))
|
||||||
firstline := true
|
|
||||||
for {
|
for {
|
||||||
line, err := reader.ReadString('\n')
|
line, err := reader.ReadString('\n')
|
||||||
if len(line) > 0 {
|
if len(line) > 0 {
|
||||||
if !firstline {
|
|
||||||
io.WriteString(out, indentation)
|
io.WriteString(out, indentation)
|
||||||
}
|
|
||||||
io.WriteString(out, line)
|
io.WriteString(out, line)
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
firstline = false
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue