view completion/_ssh-add @ 163:201c8ca43ab1

reset the environment for a proper 24 hour display of time
author Dirk Olmes <dirk@xanthippe.ping.de>
date Fri, 17 Jan 2020 15:29:03 +0100
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 "$@"