From a91b713dcec4d17f76155f0cd6b26903c59b9c19 Mon Sep 17 00:00:00 2001 From: Lukasz Kasprzak Date: Mon, 14 Sep 2026 22:31:12 +0200 Subject: plan 10: stderr messages cannot be split by quoted newlines; config paths escaped; krino new refuses control characters; independent terminal oracle --- cmd/krino/check.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'cmd/krino/check.go') diff --git a/cmd/krino/check.go b/cmd/krino/check.go index 97c1f16..d4aee01 100644 --- a/cmd/krino/check.go +++ b/cmd/krino/check.go @@ -29,25 +29,25 @@ func cmdCheck(g *globals, args []string, stdout, stderr io.Writer) int { } r := e.Check() - fmt.Fprintf(stdout, "config: %s\n", xdg.Abbrev(r.MainFile)) - fmt.Fprintf(stdout, "log: %s\n", xdg.Abbrev(r.LogFile)) - fmt.Fprintf(stdout, "cache: %s\n", xdg.Abbrev(cacheDir())) + fmt.Fprintf(stdout, "config: %s\n", display(xdg.Abbrev(r.MainFile))) + fmt.Fprintf(stdout, "log: %s\n", display(xdg.Abbrev(r.LogFile))) + fmt.Fprintf(stdout, "cache: %s\n", display(xdg.Abbrev(cacheDir()))) if len(r.Dirs) == 0 { fmt.Fprintln(stdout, "no directories included; add one with: krino new NAME PATH") } for _, dr := range r.Dirs { - fmt.Fprintf(stdout, "\n%s %s\n", dr.Dir.Name, xdg.Abbrev(dr.Dir.Root)) + fmt.Fprintf(stdout, "\n%s %s\n", display(dr.Dir.Name), display(xdg.Abbrev(dr.Dir.Root))) if dr.Missing { - fmt.Fprintf(stdout, " warning: %s is not a directory right now; it will be skipped\n", xdg.Abbrev(dr.Dir.Root)) + fmt.Fprintf(stdout, " warning: %s is not a directory right now; it will be skipped\n", display(xdg.Abbrev(dr.Dir.Root))) } for _, x := range dr.Dir.Excludes { - fmt.Fprintf(stdout, " %s\n", x.Text) + fmt.Fprintf(stdout, " %s\n", display(x.Text)) } if len(dr.Dir.Rules) == 0 { fmt.Fprintln(stdout, " no rules yet") } for i, rule := range dr.Dir.Rules { - fmt.Fprintf(stdout, " %2d %-16s %s\n", i+1, rule.Name, describeActions(rule.Conf)) + fmt.Fprintf(stdout, " %2d %-16s %s\n", i+1, display(rule.Name), display(describeActions(rule.Conf))) } } -- cgit v1.3