standard completion scheme for ssh-copy-id
This commit is contained in:
parent
41746f0bcc
commit
5decc1de04
14
contrib/ssh
14
contrib/ssh
@ -179,16 +179,18 @@ _ssh_copy_id() {
|
||||
prev=${COMP_WORDS[COMP_CWORD-1]}
|
||||
|
||||
case "$prev" in
|
||||
-*i)
|
||||
-i)
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
*)
|
||||
_known_hosts -a
|
||||
|
||||
[ $COMP_CWORD -eq 1 ] || \
|
||||
COMPREPLY=( "${COMPREPLY[@]}" $( compgen -- $cur ) )
|
||||
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user