From 07c24054cab965800983ef40f53a05c2db131ede Mon Sep 17 00:00:00 2001 From: Lukasz Kasprzak Date: Mon, 14 Sep 2026 13:26:51 +0200 Subject: krino: 0.0.3 — the plan as one block per file, wrapped, and -P MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Each file shows its steps, then the rule and the reason it matched, one field per line; on a terminal every line wraps to its width with continuation lines under their own column, and piped output is never wrapped. Choosing per file shows the same block. -P / --no-pager prints the plan without the pager. A duplicate's original is shown with ~. --- cmd/krino/main.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'cmd/krino/main.go') diff --git a/cmd/krino/main.go b/cmd/krino/main.go index 12fdf5f..6d1ef96 100644 --- a/cmd/krino/main.go +++ b/cmd/krino/main.go @@ -51,6 +51,7 @@ Sort the files in the directories listed in krino.conf by their rules. --json with -n: print the plan as JSON -c FILE use FILE instead of ~/.config/krino/krino.conf --no-color never colour the output, as when NO_COLOR is set + -P, --no-pager print the plan straight out, never through the pager -h, --help show this help --version print the version ` @@ -58,7 +59,7 @@ Sort the files in the directories listed in krino.conf by their rules. // globals holds the flags that may appear before or after a subcommand. type globals struct { yes, dry, verbose, json bool - noColor bool + noColor, noPager bool conf string } @@ -110,14 +111,17 @@ func run(args []string, stdout, stderr io.Writer) int { return cmdSort(g, rest, stdout, stderr) } -// flagSet returns a silent flag set with -c and --no-color bound to g, -// shared by every command. Each defaults to the value already parsed, so a -// flag given before a subcommand survives the subcommand's own flag set. +// flagSet returns a silent flag set with -c, --no-color and -P/--no-pager +// bound to g, shared by every command. Each defaults to the value already +// parsed, so a flag given before a subcommand survives the subcommand's own +// flag set. func flagSet(name string, g *globals) *flag.FlagSet { fs := flag.NewFlagSet(name, flag.ContinueOnError) fs.SetOutput(io.Discard) fs.StringVar(&g.conf, "c", g.conf, "") fs.BoolVar(&g.noColor, "no-color", g.noColor, "") + fs.BoolVar(&g.noPager, "no-pager", g.noPager, "") + fs.BoolVar(&g.noPager, "P", g.noPager, "") return fs } -- cgit v1.3