better verbose output
This commit is contained in:
parent
7511c09c31
commit
ba4c34b592
@ -56,11 +56,12 @@ func main() {
|
||||
cmd.Stdout = stdout
|
||||
cmd.Stderr = stderr
|
||||
|
||||
samfile = filepath.Base(samfile)
|
||||
|
||||
if e = cmd.Run(); e != nil {
|
||||
if _, ok := e.(*exec.ExitError); ok {
|
||||
str := stderr.String()
|
||||
if len(samfile) != 0 {
|
||||
samfile = "./" + filepath.Base(samfile)
|
||||
str = strings.ReplaceAll(str, "stdin, open_line is ", samfile+":")
|
||||
str = pos_rx.ReplaceAllString(str, fmt.Sprintf("%s:$1:#$2", samfile))
|
||||
}
|
||||
@ -117,7 +118,7 @@ func main() {
|
||||
func pretty(e []textdiff.Edit, p string) string {
|
||||
b := &bytes.Buffer{}
|
||||
for _, e := range e {
|
||||
fmt.Fprintf(b, "%s:#%d,#%d\n", p, e.Start, e.End)
|
||||
fmt.Fprintf(b, "%s:#%d,#%d: »%s«\n", p, e.Start, e.End, e.New)
|
||||
}
|
||||
return b.String()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user