2006-02-08 17:20:05 +08:00
|
|
|
|
|
|
|
#
|
|
|
|
# This allows us to use 'open FILENAME' to open a given file in the default
|
|
|
|
# application for the file.
|
|
|
|
#
|
|
|
|
|
|
|
|
if not test (uname) = Darwin
|
2007-01-16 09:29:18 +08:00
|
|
|
function open --description "Open file in default application"
|
2006-11-18 00:24:38 +08:00
|
|
|
if count $argv >/dev/null
|
|
|
|
switch $argv[1]
|
|
|
|
case -h --h --he --hel --help
|
2008-06-06 03:23:05 +08:00
|
|
|
__fish_print_help open
|
2006-11-18 00:24:38 +08:00
|
|
|
return 0
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2013-08-13 22:21:40 +08:00
|
|
|
if type -f cygstart >/dev/null
|
|
|
|
for i in $argv
|
|
|
|
cygstart $i
|
|
|
|
end
|
|
|
|
else if type -f xdg-open >/dev/null
|
2009-02-17 05:11:03 +08:00
|
|
|
for i in $argv
|
|
|
|
xdg-open $i
|
|
|
|
end
|
2006-10-12 00:17:49 +08:00
|
|
|
else
|
|
|
|
mimedb -l -- $argv
|
|
|
|
end
|
2006-02-08 17:20:05 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|