Created
July 9, 2024 20:22
-
-
Save filips123/e49955ad672830bb992a03a056414808 to your computer and use it in GitHub Desktop.
Winget tab completion in Zsh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#compdef winget | |
function _winget { | |
local word="${words[CURRENT]}" | |
local commandline="${words[*]}" | |
local position="$(( $CURSOR ))" | |
local completions | |
completions=("${(f)$(winget complete --word "${word}" --commandline "${words}" --position $position 2>/dev/null)}") | |
completions=("${completions[@]//$'\r'/}") | |
_describe "command" completions -o nosort | |
} | |
compdef _winget winget |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment