mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-23 02:35:38 +01:00
cdk cli tool completion suggestions plugin
This commit is contained in:
parent
b75b01a309
commit
b49a1735d4
2 changed files with 163 additions and 0 deletions
25
plugins/cdk/cdk.plugin.zsh
Normal file
25
plugins/cdk/cdk.plugin.zsh
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
# Check if the 'cdk' command is available in the system's PATH
|
||||
if ! command -v cdk >/dev/null 2>&1; then
|
||||
cdk() { npx -- cdk "$@" }
|
||||
fi
|
||||
|
||||
###-begin-cdk-completions-###
|
||||
_cdk_yargs_completions()
|
||||
{
|
||||
local reply
|
||||
local si=$IFS
|
||||
IFS=$'
|
||||
' reply=($(COMP_CWORD="$((CURRENT-1))" COMP_LINE="$BUFFER" COMP_POINT="$CURSOR" cdk --get-yargs-completions "${words[@]}"))
|
||||
IFS=$si
|
||||
# Loop through the reply array and append "tomato" to each value
|
||||
_describe 'values' reply
|
||||
}
|
||||
compdef _cdk_yargs_completions cdk
|
||||
###-end-cdk-completions-###
|
||||
|
||||
export ZSH_AUTOSUGGEST=true
|
||||
|
||||
|
||||
|
||||
autoload -U compinit
|
||||
compinit
|
||||
Loading…
Add table
Add a link
Reference in a new issue