Mercurial > hg > zsh-env
view completion/_ssh-add @ 173:f8c9b13158b8
create a default zshrc for the host
author | Dirk Olmes <dirk.olmes@codedo.de> |
---|---|
date | Sat, 04 Apr 2020 04:23:36 +0200 |
parents | a081e7a3977d |
children |
line wrap: on
line source
#compdef ssh-add _ssh-add() { local -a keys for key in $HOME/.ssh/*; do # only accept files that do not end in .pub if [[ ${key#*.pub} == "$key" ]]; then # exclude files that are not ssh keys if [[ ${key#*/config} == "$key" && ${key#*/known_hosts} == "$key" ]]; then keys+=($key) fi fi done compadd "$@" $keys } _ssh-add "$@"