diff options
| author | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-09-13 02:31:32 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-09-13 02:31:32 +0200 |
| commit | 26c94eb3db62ec6eebbf8d22c11afe691d9520c4 (patch) | |
| tree | 165e5bf69234b4f96c9b74deb4898d7143ddf120 /cmd/krino/undo.go | |
| parent | a6e442a645902011b2081c216daaec052cdc6ce6 (diff) | |
| download | krino-0.0.1.tar.gz krino-0.0.1.zip | |
krino: release 0.0.1 — man pages, install, examples, cross and release, README, changelogv0.0.1
Also: undo removes the directories its run created; a hardlink is never a
duplicate of its own other name; a flag written before "undo" is honoured;
--version prints no leading v. Duplicate conditions with different scopes
not sharing an original is documented as a known limitation.
Diffstat (limited to 'cmd/krino/undo.go')
| -rw-r--r-- | cmd/krino/undo.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/cmd/krino/undo.go b/cmd/krino/undo.go index 7ffe428..c773f9a 100644 --- a/cmd/krino/undo.go +++ b/cmd/krino/undo.go @@ -41,8 +41,10 @@ func init() { commands["undo"] = cmdUndo } // approval here is keyed by index rather than by name. func cmdUndo(g *globals, args []string, stdout, stderr io.Writer) int { fs := flagSet("undo", g) - fs.BoolVar(&g.yes, "y", false, "") - fs.BoolVar(&g.dry, "n", false, "") + // The defaults are the values run() already parsed, so -y or -n written + // before "undo" survives registering them again here. + fs.BoolVar(&g.yes, "y", g.yes, "") + fs.BoolVar(&g.dry, "n", g.dry, "") if code, ok := parse(fs, args, stdout, stderr); !ok { return code } |
