Add a completion function for completiong file url:s

darcs-hash:20070418224611-ac50b-4e457b2218751a182989f3635bb98c5e8a8b9766.gz
This commit is contained in:
axel 2007-04-19 08:46:11 +10:00
parent b9009eba96
commit 3e030bc6c6

View file

@ -0,0 +1,22 @@
function __fish_complete_file_url
set -l comp
if set -q argv[1]
set comp $argv[1]
else
set comp (commandline -ct)
end
set -l prefix (echo $comp|cut -c 1-7)
if test file:// = $prefix
set -l stripped (echo $comp|cut -c 8-)
printf "%s\n" $comp(complete -C"echo $stripped")
else
echo file://
end
end