2007-04-19 06:46:11 +08:00
|
|
|
|
|
|
|
function __fish_complete_file_url
|
2016-11-28 13:27:22 +08:00
|
|
|
set -l comp
|
2007-04-19 06:46:11 +08:00
|
|
|
|
2016-11-28 13:27:22 +08:00
|
|
|
if set -q argv[1]
|
|
|
|
set comp $argv[1]
|
|
|
|
else
|
|
|
|
set comp (commandline -ct)
|
|
|
|
end
|
2007-04-19 06:46:11 +08:00
|
|
|
|
2016-11-28 13:27:22 +08:00
|
|
|
set -l prefix (echo $comp|cut -c 1-7)
|
2007-04-19 06:46:11 +08:00
|
|
|
|
2016-11-28 13:27:22 +08:00
|
|
|
if test file:// = $prefix
|
|
|
|
set -l stripped (echo $comp|cut -c 8-)
|
|
|
|
printf "%s\n" file://(complete -C"echo $stripped")
|
|
|
|
else
|
|
|
|
echo file://
|
|
|
|
end
|
2007-04-19 06:46:11 +08:00
|
|
|
|
2007-04-21 03:55:06 +08:00
|
|
|
end
|