fork/fish-shell

git clone https://git.julia.blue/fork/fish-shell

Daniel Rainerprintf: remove all uses of length modifiers83af5c91b

master
896 B34 linesraw
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
7    function open --description "Open file in default application"
8        set -l options h/help
9        argparse -n open $options -- $argv
10        or return
11
12        if set -q _flag_help
13            __fish_print_help open
14            return 0
15        end
16
17        if not set -q argv[1]
18            printf (_ "%s: Expected at least %d args, got only %d\n") open 1 0 >&2
19            return 1
20        end
21
22        if type -q -f cygstart
23            for i in $argv
24                cygstart $i
25            end
26        else if type -q -f xdg-open
27            for i in $argv
28                xdg-open $i
29            end
30        else
31            echo (_ 'No open utility found. Try installing "xdg-open" or "xdg-utils".') >&2
32        end
33    end
34end