fish-shell/share/functions/__fish_complete_directories.fish
axel 6c8a559023 Drop unneeded '--' when using set builtin in various places
darcs-hash:20061212203727-ac50b-23fbb54bba0c5773e8a3dd2e5737ea8a670c801d.gz
2006-12-13 06:37:27 +10:00

23 lines
396 B
Fish

#
# Find directories that complete $argv[1], output them as completions
# with description $argv[2] if defined, otherwise use 'Directory'
#
function __fish_complete_directories -d "Complete using directories"
set comp $argv[1]
set desc (_ Directory)
if test (count $argv) -gt 1
set desc $argv[2]
end
eval "set dirs "$comp"*/"
if test $dirs[1]
printf "%s\t$desc\n" $dirs
end
end