fork/fish-shell
git clone https://git.julia.blue/fork/fish-shell
83af5c91b
master
1# localization: tier1 2# 3# This allows us to use 'open FILENAME' to open a given file in the default 4# application for the file. 5# 6if not command -sq open 7function open --description"Open file in default application" 8set -l options h/help 9argparse -n open$options --$argv 10or return 11 12if set -q _flag_help 13__fish_print_help open 14return 0 15end 16 17if not set -q argv[ 1 ] 18printf ( _ "%s: Expected at least %d args, got only %d\n" ) open1 0 >&2 19return 1 20end 21 22if type -q -f cygstart 23for iin $argv 24cygstart $i 25end 26else if type -q -f xdg-open 27for iin $argv 28xdg-open $i 29end 30else 31echo ( _ 'No open utility found. Try installing "xdg-open" or "xdg-utils".' ) >&2 32end 33end 34end