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

Re: optioninfo.so



Andrej Borsenkow wrote:
> 
> > Z(4):akr@serein% _ls_arguments=($(LD_PRELOAD=$PWD/optioninfo.so ls))
>                                     ^^^^^^^^^^ argh!
> >
> > Although this is not so sophisticated now and it is not portable, it
> > is very useful in some case.  How about this?

> Yes, it is not very portable. Do you suggest to use it outside of Zsh?
> Or in Zsh completion? If it can be made Zsh module - why not. But
> please, no PRELOAD fiddling.

I think it is a very nice idea and with a bit of thought and effort, we
should be able to make good use of it for the completion system. I don't
have a problem with PRELOAD fiddling.

The principle of pre-loading works on a number of platforms but I think
the specifics of it vary. On IRIX, it is something like _RLD_LIST, I
have the exact details somewhere. Where is the real getopt_long going to
be on non-Linux systems? Is it staticly compiled into and GNU binaries
and if so, will preloading still work?

What we will probably need to do is use a wrapper script around this. It
could take the same arguments as _arguments. Where we can't use
preloading, it could just pass everything straight through to
_arguments. Otherwise it would have to take the options from
optioninfo.so and merge them with the arguments we passed. This would
allow us to get at any descriptions. We would also need to account for
programs which use getopt_long but don't have a specific completion.
Another consideration is that the programs will need to be called in a
safe way so some might need a --help option.

Oliver



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