fork/fish-shell

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

Johannes AltmanningerMark private functions that don't need localizationa53db7256

master
1.2 KiB31 linesraw
1# localization: skip(private)
2function __fish_reg__complete_keys
3    set -l current_token (commandline -tc | string unescape)
4
5    set -l default_keys 'HKEY_CLASSES_ROOT\tThe information about file extension associations' \
6        'HKEY_CURRENT_USER\tThe information about a current user' \
7        'HKEY_LOCAL_MACHINE\tThe information about a current machine' \
8        'HKEY_USERS\tThe information about loaded users' \
9        'HKEY_CURRENT_CONFIG\tThe information about hardware used while startup' \
10        HKEY_DYN_DATA
11
12    if string match --quiet --entire --regex '\\\\' -- "$current_token"
13        set current_token (string replace --regex '\\\\[^\\\\]*$' '' -- "$current_token")
14
15        set -l keys (WINEDEBUG=-all wine reg query "$current_token" |
16            string replace --regex '\r' '' |
17            string match --entire --regex '\w')
18
19        test $pipestatus[1] != 0 && return
20
21        string join \n -- $keys |
22            string match --invert "$current_token" |
23            string replace --all --regex '[\\\\]+' '\\\\'
24    else
25        for key in $default_keys
26            echo -e $key
27        end
28    end
29end
30
31complete -c true -a '(__fish_reg__complete_keys)'