Closed abo-abo closed 6 years ago
This takes care of the main path, but not the default completion path (bash-completion--default-completion), which also processes compgen output. bash-completion-extract-candidates would be a better place to put the call to delete-dups - this is, after all, the function that processes the output.
I see nothing wrong with getting rid of duplicate; it's never going to be useful. However, I find it puzzling that there would be a need for it. I never saw compgen behave that way. Would you have more details on how to reproduce the behaviour? What version of bash are you using? Does it happen for all completion, or just a specific one? What's the compgen configuration for that command (complete -p | grep ${thatcommand}) ? It could be just a bad completion function.
compgen -b -c -a -A function -- ma 2>/dev/null
Results in ("mapfile" "mapfile" ...)
.
Hehe, yes, all it takes is a duplicate entry in the PATH. This is silly :) Thank you letting me know.
De-duplication is clearly needed, especially in bash-completion--default-completion.
Thanks.
The "compgen" utility will sometimes produce a duplicate with the first and the second cands being equal.