mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-25 17:55:50 +08:00
61ebc12dd4
darcs-hash:20070923210730-75c98-88557ba8b6020cae04a5e437c6bb6370e39c04d9.gz
22 lines
393 B
Fish
22 lines
393 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" --argument comp
|
|
|
|
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
|
|
|