zsh-workers
 help / color / mirror / code / Atom feed
* Recursive completion (was: RE: Reading completion manual)
@ 1999-03-03  6:39 Andrej Borsenkow
  0 siblings, 0 replies; only message in thread
From: Andrej Borsenkow @ 1999-03-03  6:39 UTC (permalink / raw)
  To: ZSH workers mailing list

May be, this solves the original problem?

> 
> As most of us, I don't like the idea of conditions with side 
> effects. But I don't like the Sven's suggestion of replacing 
> conditions with shell code either (at least, with *THIS* code :-) 
> Even more, as it does not solve the original problem - you still 
> have to save parameters and restore them after that. I'd suggest 
> something in between - conditions set special parameters 
> (elements of hash?) that can be used to extract matched 
> substrings/words. That is almost the same, as Sven's suggestion, 
> but probably more user-friendly :) something like
> 
> if [[ -between string1 string2 ]]; then
>    local -a nwords
>    nwords=(words[$FIRST,$LAST])
>     ...
> 
> 

if [[ -between string1 string2 ]]; then
    compalso  --from=first --to=last

compalso() {
   for i in $*
     case $i in
        --from=* )
           from=${i#--from=}
        ;;
  ....
   words=($words[$from,$to])
 ...
}

I bet, this can be written as one line :-)

cheers

/andrej


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1999-03-03  6:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-03-03  6:39 Recursive completion (was: RE: Reading completion manual) Andrej Borsenkow

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).