I am attempting to use bash-completion for URLs of the form "proto://host". Without the ":", I see expected behavior, with the ":" present, the URL comes out "faulty".
Bash completion has a function for hostnames,
It has a parameter
-p PREFIX that I want to use.
How to reproduce "wrong" behavior:
You need at least one "known" host on your system:
echo "gdns.google 220.127.116.11" >> /etc/hosts
Run these commands for functioning example:
$ unset COMPREPLY $ _known_hosts_real -p 'http//' -- "gdn" $ echo $COMPREPLY http//gdns.google
$ unset COMPREPLY $ _known_hosts_real -p 'http://' -- "gdn" $ echo $COMPREPLY //gdns.google
Note the only difference is the added colon in "http://". The problem here is the prefix has lost the protocol specifier and the colon. Is this expected behavior?