Remix.run Logo
ryandrake 14 hours ago

I don't want to have to type rm --wet-run tempfile.tmp every time, or mkdir -p --yes-really-do-it /usr/local/bin

The program should default to actually doing whatever thing you're asking it to do.

On the other hand it would be great if every tool had an --undo argument that would undo the last thing that program did.

homebrewer 14 hours ago | parent | next [-]

That undo program is called nilfs2, which unfortunately never became popular. I'll simply quote the kernel docs:

> NILFS2 is a log-structured file system (LFS) supporting continuous snapshotting. In addition to versioning capability of the entire file system, users can even restore files mistakenly overwritten or destroyed just a few seconds ago.

https://docs.kernel.org/filesystems/nilfs2.html

https://wiki.archlinux.org/title/NILFS2

https://en.wikipedia.org/wiki/NILFS

arjie 7 hours ago | parent | prev | next [-]

No rule is ironclad. I think matching risk to functionality is usually a good idea. For example, most modern Linuxen carry `rm` protected against root removal with `--no-preserve-root`. That is indeed `rm --wet-run` by a different name in the dangerous case.

aappleby 14 hours ago | parent | prev [-]

Sure, in those cases - but if a command has a chance of nuking prod, you want some extra step in there. Preferably something that can't be muscle-memoried through.