mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-13 05:28:49 +00:00
Add a completion function for completiong file url:s
darcs-hash:20070418224611-ac50b-4e457b2218751a182989f3635bb98c5e8a8b9766.gz
This commit is contained in:
parent
b9009eba96
commit
3e030bc6c6
1 changed files with 22 additions and 0 deletions
22
share/functions/__fish_complete_file_url.fish
Normal file
22
share/functions/__fish_complete_file_url.fish
Normal 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
|
Loading…
Reference in a new issue