myshellconfig/bash_completion.d/sshagentactions

15 lines
483 B
Text
Raw Normal View History

2020-09-24 13:05:26 +02:00
#!/bin/bash
function _sshidentities() {
[ -z "${SSH_IDENTITIES_DIR+x}" ] && { SSH_IDENTITIES_DIR="${SSH_IDENTITIES_DEFAULT_DIR-${HOME}/.ssh/identities}"; export SSH_IDENTITIES_DIR; }
COMPREPLY=()
local CUR KEYS
CUR="${COMP_WORDS[COMP_CWORD]}"
KEYS="$(find $SSH_IDENTITIES_DEFAULT_DIR -maxdepth 1 -mindepth 1 -type d -exec basename {} \;)"
COMPREPLY=( $(compgen -W "${KEYS}" -- ${CUR}) )
return 0
}
2020-09-24 13:15:16 +02:00
complete -F _sshidentities startagent loadagent token
2020-09-24 13:05:26 +02:00