case "${COMP_WORDS[1]}" in
clean)
local remotes=$(git remote -v 2>/dev/null | grep 'gcrypt::' | awk '{print $1}' | sort -u || :)
- COMPREPLY=($(compgen -W "-f --force -h --help $remotes" -- "$cur"))
+ COMPREPLY=($(compgen -W "-f --force $remotes" -- "$cur"))
return 0
;;
- check|--check)
- COMPREPLY=($(compgen -f -- "$cur"))
+ check)
+ local remotes=$(git remote -v 2>/dev/null | grep 'gcrypt::' | awk '{print $1}' | sort -u || :)
+ COMPREPLY=($(compgen -W "$remotes" -- "$cur"))
return 0
;;
capabilities|fetch|list|push)
case "${COMP_WORDS[1]}" in
clean)
local remotes=$(git remote -v 2>/dev/null | grep 'gcrypt::' | awk '{print $1}' | sort -u || :)
- COMPREPLY=($(compgen -W "-f --force -h --help $remotes" -- "$cur"))
+ COMPREPLY=($(compgen -W "-f --force $remotes" -- "$cur"))
return 0
;;
- check|--check)
- COMPREPLY=($(compgen -f -- "$cur"))
+ check)
+ local remotes=$(git remote -v 2>/dev/null | grep 'gcrypt::' | awk '{print $1}' | sort -u || :)
+ COMPREPLY=($(compgen -W "$remotes" -- "$cur"))
return 0
;;
capabilities|fetch|list|push)
;;
check)
_arguments \
- '1:gcrypt URL:_files'
+ '*:gcrypt URL: _alternative "remotes:gcrypt remote:($(git remote -v 2>/dev/null | grep "gcrypt::" | awk "{print \$1}" | sort -u))" "files:file:_files"'
;;
*)
_arguments \
;;
check)
_arguments \
- '1:gcrypt URL:_files'
+ '*:gcrypt URL: _alternative "remotes:gcrypt remote:($(git remote -v 2>/dev/null | grep "gcrypt::" | awk "{print \$1}" | sort -u))" "files:file:_files"'
;;
*)
_arguments \