[Bash-completion-devel] Merging _known_hosts_real with _known_hosts again

Guillaume Rousse Guillaume.Rousse at inria.fr
Thu Jun 11 20:12:35 UTC 2009


Freddy Vulto a écrit :
> Guillaume, about commit: d5fd1c34120c6bae2cf459e386aa08c6bc7ad223:
> ""split split _known_hosts into _known_hosts and _known_hosts_real,
> instead of using an option to set current word"
> 
> I'm having troubles with _known_hosts_real.  I already added:
> 
>    [ $ocur ] && cur=$ocur || unset -v cur
> 
> at the end, because _known_hosts_real is relying on global `cur' but
> subsequently messes it up.  I'm not really satisfied with my added
> line.  I think splitting has made things overcomplicated, so I'm
> thinking of merging them back again.  Can you recall what the split
> fixed?  Maybe I can write an automated test for it.
I was really useful for xhost completion, where you have to mangle 
currently completed word (basically, removing leading +/- character) 
before trying to complete it. Also, it is supposed to be slightly faster 
as many completion functions alread parsed the command line before 
calling this additional function.

I guess the good solution would be to have this function take one 
argument instead of relying on a global variable.
-- 
BOFH excuse #305:

IRQ-problems with the Un-Interruptible-Power-Supply



More information about the Bash-completion-devel mailing list