[Bash-completion-devel] [PATCH v2] completion: add new git_complete helper

Jonathan Nieder jrnieder at gmail.com
Mon Apr 16 20:59:52 UTC 2012


(cc-ing the bash-completion-devel list)
Felipe Contreras wrote:
> On Mon, Apr 16, 2012 at 11:46 PM, Jonathan Nieder <jrnieder at gmail.com> wrote:
>> Felipe Contreras wrote:

>>> Now, even if you use the bash completion library, it still does export
>>> functions without a prefix
>>
>> Are you sure?  "complete" is a bash builtin and has nothing to do with
>> the bash completion library except that the latter uses it.
>
> I already provided examples:
> have(), quote(), dequote(), quote_readline()

Ah, that's what you mean.  Thanks for the pointers, and sorry to have
misunderstood.

There's a little oddity here.  "have" is clearly an unwanted backward
compatibility feature:

	# @deprecated should no longer be used; generally not needed with dynamically
	#             loaded completions, and _have is suitable for runtime use.
	have()
	[...]
	unset -f have
	unset have

But "quote", "dequote", and "quote_readline" do not get the same
treatment.  Perhaps they are for backward compatibility, too, but are
so widely used that there is no hope of ever getting rid of them.

Hopefully this information helps clarify to what extent the leading
underscores in functions exposed by completion scripts are meant or
are not meant as a convention.

Jonathan



More information about the Bash-completion-devel mailing list