mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-15 14:34:05 +00:00
8b73bac580
darcs-hash:20061202233433-ac50b-48368a338773ad47807b0032389fd305d86b3275.gz
22 lines
405 B
Fish
22 lines
405 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
|
|
|