Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #15490

Re: compgen -F

Path csiph.com!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail
From Муравьев Александр <amuravyev@s-terra.ru>
Newsgroups gnu.bash.bug
Subject Re: compgen -F
Date Thu, 10 Oct 2019 11:55:22 +0300
Lines 26
Approved bug-bash@gnu.org
Message-ID <mailman.181.1570697731.9715.bug-bash@gnu.org> (permalink)
References <1fc25922-4b79-1108-0147-90edd22d16e7@case.edu> <282a0b62-91e4-8e26-d592-fde4b86abbde@s-terra.ru>
NNTP-Posting-Host lists.gnu.org
Mime-Version 1.0
Content-Type text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding 7bit
X-Trace usenet.stanford.edu 1570697731 5322 209.51.188.17 (10 Oct 2019 08:55:31 GMT)
X-Complaints-To action@cs.stanford.edu
To bug-bash@gnu.org
Envelope-to bug-bash@gnu.org
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=s-terra.ru; s=mail; t=1570697722; bh=zSgvoxrfszeC2v5azGLuOB7Dcf0VKgADZlPXlgfWca4=; h=To:In-Reply-To:From:Subject:Date:From; b=kAuuRr1GqrkugoRBgxH7r+5JjcAxsaqJzjoFsooJxwNyJzo64GPHH+Jmm9KiWsUMj c+Fks9Beg1ThEDVFoJP0BRC9YIdC4t/7jEluzyIcaQ4x8oKtKx4ZXLEmsLX/hs0K+N 9OKdWORRkzEcDaMt/VsXj1xqO7BB5D1Qi0+YcfVw=
In-Reply-To <1fc25922-4b79-1108-0147-90edd22d16e7@case.edu>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0
Content-Language en-US
X-detected-operating-system by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy]
X-Received-From 193.164.201.59
X-BeenThere bug-bash@gnu.org
X-Mailman-Version 2.1.23
Precedence list
List-Id Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe <https://lists.gnu.org/mailman/options/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive <https://lists.gnu.org/archive/html/bug-bash>
List-Post <mailto:bug-bash@gnu.org>
List-Help <mailto:bug-bash-request@gnu.org?subject=help>
List-Subscribe <https://lists.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
X-Mailman-Original-Message-ID <282a0b62-91e4-8e26-d592-fde4b86abbde@s-terra.ru>
Xref csiph.com gnu.bash.bug:15490

Show key headers only | View raw


> 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.

Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread


Thread

Re: compgen -F Муравьев Александр <amuravyev@s-terra.ru> - 2019-10-10 11:55 +0300

csiph-web