Skip to content

Commit e02c91b

Browse files
wkunertshadowspawnBenjamin E. Coe
authored
feat(zsh): Add default completion as fallback (#2331)
Fallback to default completion if no match was found (see https://zsh.sourceforge.io/Doc/Release/Completion-System.html#Completion-Functions for details on `_default`). Co-authored-by: John Gee <[email protected]> Co-authored-by: Benjamin E. Coe <[email protected]>
1 parent 8831df0 commit e02c91b

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎lib/completion-templates.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,11 @@ _{{app_name}}_yargs_completions()
4343
local si=$IFS
4444
IFS=$'\n' reply=($(COMP_CWORD="$((CURRENT-1))" COMP_LINE="$BUFFER" COMP_POINT="$CURSOR" {{app_path}} --get-yargs-completions "\${words[@]}"))
4545
IFS=$si
46-
_describe 'values' reply
46+
if [[ \${#reply} -gt 0 ]]; then
47+
_describe 'values' reply
48+
else
49+
_default
50+
fi
4751
}
4852
compdef _{{app_name}}_yargs_completions {{app_name}}
4953
###-end-{{app_name}}-completions-###

0 commit comments

Comments
 (0)