Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: rfc patch, abort rm instead of only removing the * from the cmdline



2008/8/16 Richard Hartmann <richih.mailinglist@xxxxxxxxx>:
> On Sat, Aug 16, 2008 at 01:49, Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
>
>> % rm -rf * /tmp
>> Before, even if you said no to the prompt, it will remove all your
>> files in /tmp.
>
> I am not quite sure what typo you want to catch? Maybe
>
>  rm -rf */tmp
>
> but I am not sure.
>
>
>> -                   uremnode(args, node);
>> +                   return;
>
> Silently aborting on a valid syntax is always bad. As long as you
> are in there, why not add a warning, informing the user of what
> you are doing? Also, all new code should have comments, imo :)

Maybe it was unclear from the context I gave, but I'm talking about this prompt:
% rm *
zsh: sure you want to delete all the files in /tmp/a [yn]?

Answering no to this prompt, I would expect the command to not be run,
but it is, with the * removed.

-- 
Mikael Magnusson



Messages sorted by: Reverse Date, Date, Thread, Author