Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: _diff
- X-seq: zsh-workers 9675
- From: Alexandre Duret-Lutz <duret_g@xxxxxxxx>
- To: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- Subject: Re: PATCH: _diff
- Date: 11 Feb 2000 11:14:10 +0100
- Cc: zsh-workers@xxxxxxxxxxxxxx
- In-reply-to: Sven Wischnowsky's message of "Thu, 10 Feb 2000 15:10:01 +0100 (MET)"
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
- References: <200002101410.PAA25260@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
>>> "Sven" == Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx> writes:
Sven> Oliver Kiddle wrote:
>> I object to using
>> non-local variables like _diff_is_gnu and calling 'diff' instead of
>> pulling out the first word on the command-line.
Sven> Well, if we use something like _diff_is_gnu[$words[1]], using a
Sven> non-local variable should be fine, right?
I don't think so, because _diff_options may be called from places where
$words[1] is not the command name, e.g. called from _prcs (maybe _cvs_diff
could call it too).
Hum, looking closer to _prcs, I see there is a problem, if I do
% prcs diff -P zsh -- -u <TAB>
the values of $words when entering the _diff_options functions are
diff -P zsh -- -u
(this begin with diff since $words was shifted in _prcs)
and the -P option is removed from the diff options list, which is wrong.
I'd like this array te be restricted to
-- -u
unfortunately, I don't see how to do that with _arguments.
The _arguments line calling _diff_options reads
'--[introduce diff options]:*:diff options: _diff_options'
I can't use the `*::message:action' syntax here. So I guess
I have to write an intermediate function that shift the $words
array $CURRENT times before calling _diff_options. Or I am missing
some syntaxic sugar in _arguments?
[...]
--
Alexandre Duret-Lutz
Messages sorted by:
Reverse Date,
Date,
Thread,
Author