Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Problem with _arguments
- X-seq: zsh-users 11016
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: "zsh-users@xxxxxxxxxx" <zsh-users@xxxxxxxxxx>
- Subject: Re: Problem with _arguments
- Date: Wed, 22 Nov 2006 07:55:10 -0800
- In-reply-to: <200611221039.kAMAdpal021905@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <now@xxxxxxxx> <dbfc82860611211457s3a6054d0t947d8054f553e312@xxxxxxxxxxxxxx> <200611212342.kALNg9m7006648@xxxxxxxxxxxxxxxxx> <dbfc82860611220035q30cc7278o87867885d82da92c@xxxxxxxxxxxxxx> <200611221039.kAMAdpal021905@xxxxxxxxxxxxxx>
On Nov 22, 10:39am, Peter Stephenson wrote:
}
} parsing yourself or running _arguments twice. You can edit words (the
} command line) and CURRENT (the index into it), plus it's also possible
} in some contexts to tell _arguments to limit the words visible in the
} completion that it's calling by the use of enough colons. I find
} directly manipulating words and CURRENT less infuriating.
Don't forget about compset:
-n BEGIN [ END ]
If the current word position as specified by the parameter
CURRENT is greater than or equal to BEGIN, anything up to the
BEGIN'th word is removed from the words array and the value
of the parameter CURRENT is decremented by BEGIN.
If the optional END is given, the modification is done only if
the current word position is also less than or equal to END.
In this case, the words from position END onwards are also
removed from the words array.
Both BEGIN and END may be negative to count backwards from
the last element of the words array.
-N BEG-PAT [ END-PAT ]
If one of the elements of the words array before the one at
the index given by the value of the parameter CURRENT matches
the pattern BEG-PAT, all elements up to and including the
matching one are removed from the words array and the value
of CURRENT is changed to point to the same word in the
changed array.
If the optional pattern END-PAT is also given, and there is an
element in the words array matching this pattern, the
parameters are modified only if the index of this word is
higher than the one given by the CURRENT parameter (so that
the matching word has to be after the cursor). In this case,
the words starting with the one matching end-pat are also
removed from the words array. If words contains no word
matching END-PAT, the testing and modification is performed
as if it were not given.
So it should work to do something like
compset -N '[^-]*'
before calling _arguments.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author