fork/fish-shell

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

Johannes AltmanningerMark private functions that don't need localizationa53db7256

master
1020 B52 linesraw
1# localization: skip(private)
2function __fish_gnu_complete -d "Wrapper for the complete built-in. Skips the long completions on non-GNU systems"
3    set -l is_gnu 0
4
5    set -l argv_out
6
7    # Check if we are using a gnu system
8    for i in $argv
9        switch $i
10
11            case -g --is-gnu
12                set is_gnu 1
13
14            case '*'
15                set argv_out $argv_out $i
16        end
17    end
18
19    set argv $argv_out
20    set argv_out
21    set -l skip_next 0
22
23    # Remove long option if not on a gnu system
24    switch $is_gnu
25        case 0
26            for i in $argv
27
28                switch $skip_next
29
30                    case 1
31                        set skip_next 0
32                        continue
33
34                end
35
36                switch $i
37
38                    case -l --long
39                        set skip_next 1
40                        continue
41
42                end
43
44                set argv_out $argv_out $i
45            end
46            set argv $argv_out
47
48    end
49
50    complete $argv
51
52end