bash-completion
bash-completion copied to clipboard
Add a postfix opt to _known_hosts_real
trafficstars
I create an opt like -c because I like develop an ansible bash_completion file. And the colon suffix is required to ansible's inventory opts.
Could you elaborate on your use case more? You mention needing a colon suffix, but we already have the -c option which adds a colon suffix. Note also that you can add some other suffix to completions using for example something like this (adds a comma, add compopt -o nospace if you want it):
_known_hosts_real -- "$cur"
COMPREPLY=( $( compgen -S , -W '${COMPREPLY[@]}' -- "$cur" ) )
It's may be beautiful in one-liner.
What about the colon, we already have -c which adds it, and you mentioned that's what your completion requires?