=Completion support for cz alias

This commit is contained in:
Gal Szkolnik 2022-08-02 07:26:18 -04:00
parent d34c3b15d6
commit c14288eac0
2 changed files with 5 additions and 1 deletions

View File

@ -1 +1 @@
[[ -n "$BASH_COMPLETION_EXIST" && -n $(type -fP chezmoi) ]] && source <(chezmoi completion bash) [[ -n "$BASH_COMPLETION_EXIST" && -n $(type -fP chezmoi) ]] && source <(chezmoi completion bash | add-alias-to-bash-completion-code cz )

View File

@ -1,2 +1,6 @@
alias which-command="type -fP " alias which-command="type -fP "
function add-alias-to-bash-completion-code() {
local CMD=$(printf "%s" "sed '" 's/\(complete\W.*-F\W.*chezmoi\)/\1 ' "$1/g'")
eval "$CMD"
}