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

Re: completion within a function



On Tue, Dec 29, 2020 at 4:32 PM Ray Andrews <rayandrews@xxxxxxxxxxx> wrote:
>
>      new_var=$( complete_it $1 )
>
> where 'complete _it' is a function that does just what TAB would do on
> the command line.

Along with what Roman said ... where does the context come from?

That is, if you were completing (the string represented by) $1 on the
command line, you have the whole rest of the line, or at least
everything preceding it, to establish how the input should be
interpreted.  So it can't be as simple as passing a single word as
argument.




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