diff options
| author | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-09-14 15:16:55 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-09-14 15:16:55 +0200 |
| commit | 0b5d0eb92c5be2f0ddb2fa73990f31e5654e57fe (patch) | |
| tree | 358e331945b8206ed4a72703e3aedfe8ea7cdcdb /cmd/krino/undo.go | |
| parent | 1d3f2d1e4c59867024470d3444e12698b7ebb22e (diff) | |
| download | krino-0.0.5.tar.gz krino-0.0.5.zip | |
krino: 0.0.5 — keyword cache, t and d in reviewv0.0.5
Diffstat (limited to 'cmd/krino/undo.go')
| -rw-r--r-- | cmd/krino/undo.go | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/cmd/krino/undo.go b/cmd/krino/undo.go index d31a5b3..036e3c0 100644 --- a/cmd/krino/undo.go +++ b/cmd/krino/undo.go @@ -325,7 +325,7 @@ func reviewUndoDir(out io.Writer, files []engine.UndoFile, p palette) (map[int]b // // menu, and, for [c], the per-file // -// [y] yes [n] no [a] yes to this and all remaining [d] done, apply chosen so far [q] quit, apply nothing +// [y] yes [n] no [a] yes to this and all remaining [w] write, apply chosen so far [q] quit, apply nothing // // prompt - the same shape as review.go's reviewChains/reviewPerFile, over a // different plan shape (approved is keyed by index into files, not by @@ -386,7 +386,7 @@ func reviewUndoPerFile(in io.Reader, out io.Writer, files []engine.UndoFile, p p continue } - for _, l := range wrapped(" ", perFileKeys, 2, widthPolicy(out), p.keys) { + for _, l := range wrapped(" ", undoPerFileKeys, 2, widthPolicy(out), p.keys) { fmt.Fprintln(out, l) } for { @@ -402,12 +402,12 @@ func reviewUndoPerFile(in io.Reader, out io.Writer, files []engine.UndoFile, p p case 'a': approved[i] = true yesRest = true - case 'd': + case 'w': return approved, false, nil case 'q': return nil, true, nil default: - fmt.Fprintf(out, "%q is not y, n, a, d or q\n", key) + fmt.Fprintf(out, "%q is not y, n, a, w or q\n", key) continue } break @@ -416,6 +416,10 @@ func reviewUndoPerFile(in io.Reader, out io.Writer, files []engine.UndoFile, p p return approved, false, nil } +// undoPerFileKeys is undo's per-file prompt: review's without [t] and [d], +// which make no sense for a reversal. +const undoPerFileKeys = "[y] yes [n] no [a] yes to this and all remaining [w] write, apply chosen so far [q] quit, apply nothing" + // approveAllUndo approves every reversible file in files by index - [a] // apply all, at either the top level or mid per-file review. A refused file // is never marked true: nothing would happen to it anyway (ApplyUndo skips |
