fish-shell/init/functions/__fish_complete_directory.fish
axel 73a9c8bcb8 Autoloaded functions
darcs-hash:20060208092005-ac50b-8e784f79a4e158c8c15b553fad85002dccc7bd03.gz
2006-02-08 19:20:05 +10:00

22 lines
403 B
Fish

#
# Find directories that complete $argv[1], output them as completions
# with description $argv[2] if defined, otherwise use 'Directory'
#
function __fish_complete_directory -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