[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: compgen -F
From: |
Муравьев Александр |
Subject: |
Re: compgen -F |
Date: |
Thu, 10 Oct 2019 11:55:22 +0300 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 |
What does `works' mean here,
It means to work like "compgen -c pin", or like
_completion_loader ping; COMP_WORDS=(ping); COMP_CWORD=1;
_known_hosts; declare -p COMPREPLY
or somehow else get possible completion results.
and what are you trying to do with this patch?
I am trying to provide "pcomp_line" buffer which
"gen_compspec_completion" function expect to be. Normally when we just
press <TAB> after "ping ", "pcomp_line" is provided by
"programmable_completions" function (it assign the buffer pointer to
line buffer). This function is called from "attempt_shell_completion"
function according to special logic which it consists (it determines
whether programmable completion is needed).
On the other hand, "compgen" realization function ("compgen_builtin")
just set pcom_line buffer pointer to NULL. Consequently, no programmable
completion is possible in this case, because "pcomp_line" buffer is
necessary. The buffer is parsed in "gen_compspec_completions" in order
to bind variables like "COMP_WORDS", which are used in programmable
completions bash scripts in /usr/share/bash-completion/.
Hope I said clearly. It is second language for me.