diff options
| author | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-09-14 13:26:51 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-09-14 13:26:51 +0200 |
| commit | 07c24054cab965800983ef40f53a05c2db131ede (patch) | |
| tree | 741db561d614b35f8f94fee04fb5ce663a629a0b /docs/design.md | |
| parent | 70dccf8d573028aaed64185acb8e134e5339afa3 (diff) | |
| download | krino-0.0.3.tar.gz krino-0.0.3.zip | |
krino: 0.0.3 — the plan as one block per file, wrapped, and -Pv0.0.3
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 ~.
Diffstat (limited to 'docs/design.md')
| -rw-r--r-- | docs/design.md | 71 |
1 files changed, 56 insertions, 15 deletions
diff --git a/docs/design.md b/docs/design.md index 82168e5..437b602 100644 --- a/docs/design.md +++ b/docs/design.md @@ -2,7 +2,8 @@ Status: describes krino 0.0.1, 2026-09-13; amended 2026-09-14 for 0.0.2: duplicates are never deleted (§5.5), and coloured output with `--no-color` -(§8.2, §11). +(§8.2, §11); amended again 2026-09-14 for 0.0.3: the plan +shown as one block per file, wrapped to the terminal, and `-P` (§8.2, §8.3, §11). krino (from Greek κρίνω, "to separate, to judge, to decide") sorts files in chosen directories by rules. A rule tests a file's type, name, path, size, @@ -402,29 +403,60 @@ name has to change, the log records the actual name. ### 8.2 Display -One directory at a time: +One directory at a time, one block per file that has steps: its number and +name, then each step under its kind word, then after each rule's steps that +rule's name and the reason it matched (left out for a rule with no +condition): ``` krino: downloads ~/downloads -266 scanned · 41 to act on · 2 warnings +266 scanned · 41 to act on · 2 warnings · 13.67s - # file actions rule - 1 scan001.pdf move → Work/Acme/2026/ acme content "acme ltd" - 2 fv_123.pdf copy → ~/backup/invoices/2026/ backup content "invoice" - move → Work/Acme/2026/ acme name \bacme\b - 3 IMG_2031.JPG rename → 2026-09-01_IMG_2031.JPG photos type image - move → Photos/2026/ - 4 setup-1.2.deb DELETE permanently old-pkgs age 94d - 5 report (1).pdf move → ~/.dupes/ dupes duplicate of Work/report.pdf + 1 scan001.pdf + move → Work/Acme/2026/ + rule acme + because content "acme ltd" + + 2 fv_123.pdf + copy → ~/backup/invoices/2026/ + rule backup + because content "invoice" + move → Work/Acme/2026/ + rule acme + because name \bacme\b + + 3 IMG_2031.JPG + rename → 2026-09-01_IMG_2031.JPG + move → Photos/2026/ + rule photos + because type image + + 4 setup-1.2.deb + DELETE permanently + rule old-pkgs + because age 94d + + 5 report (1).pdf + move → ~/.dupes/ + rule dupes + because duplicate of ~/docs/work/report.pdf warnings brochure.doc content unreadable: antiword/catdoc not installed (rule acme) big.pdf content unreadable: 120M > max-read 50M + not acted on: 3 busy · 12 ignored · 210 unmatched (-v lists them) -[a] apply all [c] choose per file [s] skip this directory [q] quit +[a] apply all [c] choose per file [s] skip this directory [q] quit ``` +- On a terminal, every line is wrapped to its width: a long name, path or + reason continues on lines indented under its own first column, breaking + after a space, `/`, `_` or `-` where it can. Output that is not a + terminal is never wrapped, so a plan redirected to a file keeps each + field on one line. +- Paths are shown relative to the directory when inside it, and with `~` + for the home directory otherwise. - Colours use only the terminal's 16-colour ANSI palette plus bold and faint, never 256-colour or RGB values, so the terminal's theme decides what they look like. They appear only on a terminal, and never when `NO_COLOR` @@ -446,7 +478,8 @@ not acted on: 3 busy · 12 ignored · 210 unmatched (-v lists them) Permanent deletes are always marked in capitals, so they stand out without colour too. - A plan taller than the terminal is shown through `$PAGER` (default - `less -FRX`) and the prompt follows when the pager exits. + `less -FRX`) and the prompt follows when the pager exits. `-P` + (`--no-pager`) prints it straight to the terminal instead. - Keys are read one at a time without Enter. - `[s]` applies nothing in this directory and moves on to the next one. `[q]` stops krino; directories already applied in this run stay applied @@ -454,10 +487,17 @@ not acted on: 3 busy · 12 ignored · 210 unmatched (-v lists them) ### 8.3 Choosing per file +Each file shows the same block the plan shows, under its position in the +list: + ``` [2/41] fv_123.pdf - copy → ~/backup/invoices/2026/ - move → Work/Acme/2026/ + copy → ~/backup/invoices/2026/ + rule backup + because content "invoice" + move → Work/Acme/2026/ + rule acme + because name \bacme\b [y] yes [n] no [a] yes to this and all remaining [d] done, apply chosen so far [q] quit, apply nothing ``` @@ -539,6 +579,7 @@ krino undo [RUN] reverse a run (default: the last one) --json with -n: the plan as JSON (format unstable before 1.0) -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 help --version print "krino 0.0.1" ``` |
