2006-02-08 09:20:05 +00: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 01:29:18 +00:00
|
|
|
function open --description "Open file in default application"
|
2006-11-17 16:24:38 +00:00
|
|
|
if count $argv >/dev/null
|
|
|
|
switch $argv[1]
|
|
|
|
case -h --h --he --hel --help
|
2008-06-05 19:23:05 +00:00
|
|
|
__fish_print_help open
|
2006-11-17 16:24:38 +00:00
|
|
|
return 0
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2006-10-11 16:17:49 +00:00
|
|
|
if type -f xdg-open >/dev/null
|
2009-02-16 21:11:03 +00:00
|
|
|
for i in $argv
|
|
|
|
xdg-open $i
|
|
|
|
end
|
2006-10-11 16:17:49 +00:00
|
|
|
else
|
|
|
|
mimedb -l -- $argv
|
|
|
|
end
|
2006-02-08 09:20:05 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|