[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Wishing rmdir had a prompt
From: |
Bernhard Voelker |
Subject: |
Re: Wishing rmdir had a prompt |
Date: |
Mon, 2 Sep 2019 17:22:22 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 |
On 9/2/19 10:03 AM, Sami Kerola wrote:
[...] I don't see any problem adding --interactive long
only option.
a) Bloat:
Apart from the --parents option, rmdir(1) is just a simple
wrapper around rmdir(2).
Just recently I've been asked (off-list) why src/true.c needs
to have 80+ lines while 3 lines would be enough.
b) Alternatives:
The case is trivial enough to have some little prompt wrapper around it.
E.g. a bit contrived but works:
$ xargs -p rmdir DIR </dev/null
rmdir DIR ?...y
c) As Kaz already wrote: it's easy enough to re-create an empty directory
which has been deleted accidentally.
d) My personal opinion: I'm not in favor of those "do you really want to XYZ?"
questions - especially in the case one just explicitly told the tool exactly
to "do XYZ". Similarly, one could argument why not to add it to sleep,
kill, cat, and so on.
Have a nice day,
Berny