Interactive dirs extension to rm
I want to not have to type rm -r when I remove a directory, and also I want it secure so I've aliased rm to coreutils rm -rI. The problem is that I get prompted even when removing files. This behavior is present in GNU as well. So I suggest adding a --interactive=dirs option. It will prompt only when at least one of the arguments is a directory.
Behaviour of rm -rI
user@machine> rm -rI foo
rm: remove 1 argument recursively?
It removes recursively no matter whether the argument is a file or directory
Requested behavior of rm -r --interactive=dirs
user@machine> rm -r --interactive=dirs foo
user@machine>
When no arguments are directories it doesn't remove recursively
user@machine> rm -r --interactive=dirs foo bar/
rm: remove 2 arguments recursively?
When at least one argument is a directory it produces the same behavior as rm -rI
Thanks! Could you replace the screenshots with text?
Thanks! Could you replace the screenshots with text?
Done
If this ever gets implemented, please don't call it --smart-recursive, as it only interacts with the level of iteractiveness, i.e. it lies on a scale: --interactive=always, --interactive=once, <your requested feature>, --interactive=never.
I propose instead: --interactive=dirs
Okay
Now edited the issue to interactive dirs