2006-02-08 17:20:05 +08:00
|
|
|
#
|
|
|
|
# Find directories that complete $argv[1], output them as completions
|
|
|
|
# with description $argv[2] if defined, otherwise use 'Directory'
|
|
|
|
#
|
|
|
|
|
2007-09-24 05:07:30 +08:00
|
|
|
function __fish_complete_directories -d "Complete using directories" --argument comp
|
2006-02-08 17:20:05 +08:00
|
|
|
|
2016-11-28 13:27:22 +08:00
|
|
|
set desc (_ Directory)
|
2006-02-08 17:20:05 +08:00
|
|
|
|
2016-11-28 13:27:22 +08:00
|
|
|
if test (count $argv) -gt 1
|
|
|
|
set desc $argv[2]
|
|
|
|
end
|
2006-02-08 17:20:05 +08:00
|
|
|
|
2016-11-28 13:27:22 +08:00
|
|
|
eval "set dirs "$comp"*/"
|
2006-02-08 17:20:05 +08:00
|
|
|
|
2016-11-28 13:27:22 +08:00
|
|
|
if test $dirs[1]
|
|
|
|
printf "%s\t$desc\n" $dirs
|
|
|
|
end
|
2006-02-08 17:20:05 +08:00
|
|
|
|
|
|
|
end
|
|
|
|
|