diff options
Diffstat (limited to 'cmd/krino/explain.go')
| -rw-r--r-- | cmd/krino/explain.go | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/cmd/krino/explain.go b/cmd/krino/explain.go index a4d0253..6f8fa26 100644 --- a/cmd/krino/explain.go +++ b/cmd/krino/explain.go @@ -26,12 +26,19 @@ func cmdExplain(g *globals, args []string, stdout, stderr io.Writer) int { if fs.NArg() != 1 { return usageError(stderr, "usage: krino explain FILE") } + minAge, setMinAge, err := minAgeOverride(g) + if err != nil { + return usageError(stderr, err.Error()) + } e, errs := engine.Load(mainFile(g)) if len(errs) > 0 { printDiags(stderr, errs) return 2 } + if setMinAge { + applyMinAge(e, minAge) + } x, err := e.Explain(context.Background(), xdg.Expand(fs.Arg(0))) if err != nil { @@ -43,7 +50,18 @@ func cmdExplain(g *globals, args []string, stdout, stderr io.Writer) int { if x.Skip != "" { fmt.Fprintf(stdout, "krino would not look at this file: %s\n", x.Skip) } + if x.Excluded != "" { + fmt.Fprintf(stdout, "krino would set this file aside: %s\n", x.Excluded) + } fmt.Fprintln(stdout) + for _, xt := range x.Excludes { + status := "no" + if xt.Match { + status = "MATCH" + } + fmt.Fprintf(stdout, "%s: %s\n", xt.Text, status) + printTrace(stdout, xt.Trace) + } for _, rt := range x.Rules { if rt.Stopped != "" { fmt.Fprintf(stdout, "rule %s: not evaluated, %s\n", rt.Rule.Name, rt.Stopped) |
