forked from yargs/yargs
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: zsh auto completion (yargs#1292)
fixes: yargs#1156
- Loading branch information
1 parent
706fc7a
commit 16c5d25
Showing
5 changed files
with
170 additions
and
16 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
###-begin-{{app_name}}-completions-### | ||
# | ||
# yargs command completion script | ||
# | ||
# Installation: {{app_path}} {{completion_command}} >> ~/.zshrc | ||
# or {{app_path}} {{completion_command}} >> ~/.zsh_profile on OSX. | ||
# | ||
_{{app_name}}_yargs_completions() | ||
{ | ||
local reply | ||
local si=$IFS | ||
IFS=$'\n' reply=($(COMP_CWORD="$((CURRENT-1))" COMP_LINE="$BUFFER" COMP_POINT="$CURSOR" {{app_path}} --get-yargs-completions "$\{words[@]\}")) | ||
IFS=$si | ||
_describe 'values' reply | ||
} | ||
compdef _{{app_name}}_yargs_completions {{app_name}} | ||
###-end-{{app_name}}-completions-### |
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
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
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
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