I have a custom cli tool that i want to setup with bash_completion but want [tab][tab] to perform an enter action on cmdline.
my bash_completion file for wonder is:
_wonder()
{
local cur=${COMP_WORDS[COMP_CWORD]}
COMPREPLY=( $(compgen -W "audit nodes tools create debug delete update" -- $cur) )
}
complete -F _wonder wonder
currently:
$ wonder [tab] [tab]
returns:
ip-10-99-18-249:loco_dsl jasonparmar$ wonder
audit create debug delete nodes tools update
What I want is when i use the tools option from wonder:
$ wonder tools [tab] [tab]
I want the [tab][tab] to force an enter on the cmdline
How can i edit my bash_completion file for wonder to achieve this.
Is this even possible with bash_completion.
Thanks in advance.