This repository has been archived by the owner on Feb 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix shell completion after update to urfave/cli@2.0.0
Depends on urfave/cli#946
- Loading branch information
Roberto Hidalgo
committed
Dec 2, 2019
1 parent
e16523d
commit 92b70c7
Showing
5 changed files
with
56 additions
and
19 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,21 @@ | ||
#compdef gcy | ||
#autoload | ||
# shellcheck shell=bash | ||
autoload -U compinit && compinit; | ||
autoload -U bashcompinit && bashcompinit; | ||
|
||
_cli_bash_autocomplete() { | ||
local cur opts; | ||
COMPREPLY=(); | ||
cur="${COMP_WORDS[COMP_CWORD]}"; | ||
opts=$( CUR="$cur" "${COMP_WORDS[@]:0:$COMP_CWORD}" --generate-completion ); | ||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ); | ||
return 0; | ||
}; | ||
_gcy_zsh_autocomplete () { | ||
|
||
_gcy () { | ||
complete -o nospace -o default -F _cli_bash_autocomplete gcy | ||
local -a opts | ||
opts=("${(@f)$(_CLI_ZSH_AUTOCOMPLETE_HACK=1 ${words[@]:0:#words[@]-1} --generate-bash-completion)}") | ||
|
||
exit_code="$?" | ||
if [[ $exit_code -gt 0 ]]; then | ||
_path_files | ||
[[ $exit_code == 1 ]]; return | ||
fi | ||
|
||
_describe 'gcy' opts | ||
|
||
return | ||
} | ||
|
||
compdef _gcy_zsh_autocomplete gcy |
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