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

Re: User-defined completion listing



On Nov 19,  6:00pm, Peter Stephenson wrote:
} Subject: PATCH: User-defined completion listing
}
} Now the good news:  the syntax (see manual patch for more) is either
} 
}   compctl ... -Y '$array'
} or
}   compctl ... -Y 'func'
} 
} In the first case, $array is, err, an array, in the second, func is
} called and must set $reply, just like a -K function.

I must confess confusion as to why you'd do it this way.

If you're going to examine the first character and behave differently
when it is '$', you could do that with -X and not need a new option.

If you're going to expand a variable, why does it have to be an array?
The parameter to -X is just a string.

If you're going to substitute a string, why pass it around with $reply?

} Another thing under the `could perhaps be better, but it's time I did
} some work' heading:  literal arrays are allowed as with -k, i.e. -Y
} '(option1 option2 ...)', but there's no way of getting a literal
} string there.

Why do you need to pass a literal string to -Y when you can use -X ?

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



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