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

zsh completion with _files



Hi,

i am writing my own zsh completion for a program.
I started today and used _arguments, _describe, compadd and _files so far.
I used tests for the previous and the pre-previous word like
$words[$#words-1 or 2] .

Now I am wondering how I can achieve this:

If the user types a "@" this marks that after the at-sign filenames are
allowed to be entered.
So I need to check the current word and compare it accordingly.

I realized that it might work this way:

        local curr=$words[$#words]

        case $curr in
        @*)
                _files
        ;;
        esac

But then it is looking for files starting with @.
So I wonder if there is any parameter telling the _files function to
drop the first character.
I see there is many documentation, but I did not find anything it it -
maybe since I do not know what to search for...

THanks a lot and kind regards
Cornelius

Attachment: signature.asc
Description: OpenPGP digital signature



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