From ba4c34b5921ca3d7888e20856c0e778186fab421 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96zg=C3=BCr=20Kesim?= Date: Sun, 8 Dec 2024 23:40:09 +0100 Subject: [PATCH] better verbose output --- uncrust.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/uncrust.go b/uncrust.go index 2a7f904..c08a5d9 100644 --- a/uncrust.go +++ b/uncrust.go @@ -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() }