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

Re: rm(1) completion definition



On Wed, Oct 1, 2008 at 11:38, Oliver Kiddle <okiddle@xxxxxxxxxxx> wrote:

> Nikolai Weibull wrote:

>> 1.  It seems that my trick to disable --force and --recursive on
>> non-GNU systems doesn't work.

> This is better done as:
>  args=( ${args:#*--(force|recursive)\[*} )

Thanks, will change to that.

>> 2.  I'm not sure if the zstyle thing is correct, but it's definitely
>> what you want it to do.  Is there a better way to achieve the same
>> effect?
>
> The problem with the zstyle stuff is that you've used single quotes so
> $curcontext is not expanded.

Duh.  Forgot to change that.

> The right way to do this would be to work out exactly what can't be
> completed and build up a suitable glob pattern to pass to _files with
> -g.

Ugh.  That sounds complicated.

> One other point: I really hope that running rm --version can't possibly
> actually result in a file or files being removed on some system. I'm a
> bit uneasy about it. Perhaps you should try using rm --help instead
> because there's no `r' in help.

OK, sounds reasonable.

Thank you for your pointers



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