mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-25 10:11:17 -03:00
fish's internal completion logic is much smarter than the globbing in this function, so let's just reuse "complete -C", and filter directories and files with the given suffix. Thanks to @Kratacoa for reporting on Gitter. Using "complete -C" works well no prefix is given. Since in this repository only the openocd completions pass a prefix, I left the prefix-case as is. It could probably be improved and simplified as well. The prefix argument was introduced to avoid cd's side effects inside a completion. Using cd is tempting though because it would allow to use the same logic as without a prefix.