standard completion scheme for ssh-copy-id

This commit is contained in:
Guillaume Rousse 2009-05-02 17:23:21 +02:00
parent 41746f0bcc
commit 5decc1de04

View File

@ -179,16 +179,18 @@ _ssh_copy_id() {
prev=${COMP_WORDS[COMP_CWORD-1]} prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in case "$prev" in
-*i) -i)
_filedir _filedir
;; return 0
*) ;;
_known_hosts -a
[ $COMP_CWORD -eq 1 ] || \
COMPREPLY=( "${COMPREPLY[@]}" $( compgen -- $cur ) )
esac esac
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '-i' -- $cur ) )
else
_known_hosts -a
fi
return 0 return 0
} }
complete -F _ssh_copy_id $filenames ssh-copy-id complete -F _ssh_copy_id $filenames ssh-copy-id