[Bash-completion-devel] test if completion is enabled before invoking it

CircleCode codronm+circlecode at gmail.com
Mon Feb 11 09:16:56 UTC 2013


>
> On Wed, Feb 06, 2013 at 05:50:08PM +0100, CircleCode wrote:
> [...]
> > Is there a way to detect that a git completion is enabled before invoking
> > it?
>
> $ complete -p git && echo "git completion is enabled"
> # or did I missed something ?
>
> the trick is that it seems dynamic:

here come 3 commands I launch successivley:

 $ complete -p git
bash: complete: git : pas d'indication de complètement
# which is the French for "no completion indications"

$ git <tab><tab>
[…] (completions)

$ complete -p git
complete -o bashdefault -o default -o nospace -F __git_wrap__git_main git
# here you can see than after the completion function has been used once,
it is shown by git complete -p
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/bash-completion-devel/attachments/20130211/5ddb5428/attachment.html>


More information about the Bash-completion-devel mailing list