Re:I Accidentally Deleted 7TB of Videos Before Going to Prod...
by InfoSecErik on Thursday May 05, 2022 @12:43PM
(#31275592)
I tend towards a --dry-run flag for creative actions and --confirm for destructive actions. Probably sightly annoying that the commands end up seemingly different, but it sure beats accidentally nuking something important.
This pattern has the added benefit that it makes it really easy to write unit tests, which is something often sorely lacking in these sorts of batch scripts. It also makes full automation down the line a breeze, since you have nice shearing layers between your components.
http://www.laputan.org/mud/mud.html#ShearingLayers