@ -16,12 +16,12 @@ func (r fileResult) String(verbose bool) string {
ss := make([]string, 0, len(r.urlResults))
if r.err != nil {
ss = append(ss, "\t"+color.RedString(r.err.Error()))
ss = append(ss, indent(color.RedString(r.err.Error())))
}
for _, r := range r.urlResults {
if r.err != nil || verbose {
ss = append(ss, "\t"+r.String())
ss = append(ss, indent(r.String()))
@ -12,5 +12,5 @@ func (r urlResult) String() string {
return color.GreenString("OK") + "\t" + r.url
return color.RedString("ERROR") + "\t" + r.url + "\t" + color.YellowString(r.err.Error())
return color.RedString("ERROR") + "\t" + r.url + "\n\t" + color.YellowString(r.err.Error())
@ -3,6 +3,8 @@ package main
import (
"fmt"
"os"
"github.com/kr/text"
)
func stringSetToSlice(s2b map[string]bool) []string {
@ -18,3 +20,7 @@ func stringSetToSlice(s2b map[string]bool) []string {
func printToStderr(xs ...interface{}) {
fmt.Fprintln(os.Stderr, xs...)
func indent(s string) string {
return text.Indent(s, "\t")