aboutsummaryrefslogtreecommitdiff
path: root/cmd/krino/undo.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/krino/undo.go')
-rw-r--r--cmd/krino/undo.go12
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