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

Re: completion within a function



On Wed, Dec 30, 2020 at 1:44 AM Ray Andrews <rayandrews@xxxxxxxxxxx> wrote:
>  How could I simulate the effect of completing
> on $1 within the function automatically?  Or perhaps:
>
>      new_var=$( complete_it $1 )
>
> where 'complete_it' is a function that does just what TAB would do on
> the command line.

Where and how do you want to invoke this code? From a non-interactive
script? From an interactive shell by pressing a key combination?
Something else?

If there are several possible completions, should comple_it return all
of them? Show a completion menu? Fail? Something else?

Should complete_it respect all completion options and zstyle definitions?

It would help if you can describe what you want to achieve from the
user's point of view with as little presumption of implementation as
possible.

Roman.




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