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
|
|
|
|
|
2014-07-10 07:26:58 +00:00
|
|
|
if type -q -f cygstart
|
2013-08-13 14:21:40 +00:00
|
|
|
for i in $argv
|
|
|
|
cygstart $i
|
|
|
|
end
|
2014-07-10 07:26:58 +00:00
|
|
|
else if type -q -f xdg-open
|
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
|
2015-07-20 01:00:31 +00:00
|
|
|
echo (_ 'No open utility found. Try installing "xdg-open" or "xdg-utils".')
|
2006-10-11 16:17:49 +00:00
|
|
|
end
|
2006-02-08 09:20:05 +00:00
|
|
|
end
|
|
|
|
end
|