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]}
case "$prev" in
-*i)
_filedir
;;
*)
_known_hosts -a
[ $COMP_CWORD -eq 1 ] || \
COMPREPLY=( "${COMPREPLY[@]}" $( compgen -- $cur ) )
-i)
_filedir
return 0
;;
esac
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '-i' -- $cur ) )
else
_known_hosts -a
fi
return 0
}
complete -F _ssh_copy_id $filenames ssh-copy-id