mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-04-30 01:11:14 -03:00
Update completions for: wine (#10789)
* feat(function): move cmd completion function to a separate file * feat(completion): support wine cmd subcommand * feat(completion): support wine control subcommand * feat(completion): support wine eject subcommand * feat(completion): support wine explorer subcommand * feat(completion): support wine explorer subcommand for desktops * feat(completion): support wine start subcommand * feat(completion): support wine winemenubuilder subcommand * feat(completion): support wine winepath subcommand * fix(function): rename function for cmd argument completion * feat(function): implement function to complete registry keys * feat(completion): support wine regedit subcommand * feat(function): add top-level key descriptions * fix(completion): remove redundant comment * feat(completion): support wine msiexec subcommand * refactor(completion): group code into functions * feat(completion): enhance subcommand descriptions
This commit is contained in:
committed by
GitHub
parent
93aa5a9376
commit
262e2d5fe6
30
share/functions/__fish_reg__complete_keys.fish
Normal file
30
share/functions/__fish_reg__complete_keys.fish
Normal file
@@ -0,0 +1,30 @@
|
||||
function __fish_reg__complete_keys
|
||||
set -l current_token (commandline -tc | string unescape)
|
||||
|
||||
set -l default_keys 'HKEY_CLASSES_ROOT\tThe information about file extension associations' \
|
||||
'HKEY_CURRENT_USER\tThe information about a current user' \
|
||||
'HKEY_LOCAL_MACHINE\tThe information about a current machine' \
|
||||
'HKEY_USERS\tThe information about loaded users' \
|
||||
'HKEY_CURRENT_CONFIG\tThe information about hardware used while startup' \
|
||||
HKEY_DYN_DATA
|
||||
|
||||
if string match --quiet --entire --regex '\\\\' -- "$current_token"
|
||||
set current_token (string replace --regex '\\\\[^\\\\]*$' '' -- "$current_token")
|
||||
|
||||
set -l keys (WINEDEBUG=-all wine reg query "$current_token" |
|
||||
string replace --regex '\r' '' |
|
||||
string match --entire --regex '\w')
|
||||
|
||||
test $pipestatus[1] != 0 && return
|
||||
|
||||
string join \n -- $keys |
|
||||
string match --invert "$current_token" |
|
||||
string replace --all --regex '[\\\\]+' '\\\\'
|
||||
else
|
||||
for key in $default_keys
|
||||
echo -e $key
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
complete -c true -a '(__fish_reg__complete_keys)'
|
||||
Reference in New Issue
Block a user