mirror of
https://github.com/nikdoof/dotfiles.git
synced 2025-12-13 09:42:27 +00:00
Fix add-sshkey auto completions for keys with multiple underscores in them
This commit is contained in:
@@ -9,10 +9,11 @@ function _add-sshkey() {
|
|||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
for id in $HOME/.ssh/id_ed25519_*; do
|
for id in $HOME/.ssh/id_ed25519_*; do
|
||||||
name=$(basename $id | cut -d'_' -f3 | cut -d'.' -f1)
|
name=$(basename $id | cut -d'_' -f3- | cut -d'.' -f1)
|
||||||
[[ ${id:-3} != 'pub' ]] && identities+=$name
|
[[ ${id:-3} != 'pub' ]] && identities+=$name
|
||||||
done
|
done
|
||||||
|
|
||||||
compadd $identities
|
compadd $identities
|
||||||
}
|
}
|
||||||
compdef _add-sshkey add-sshkey
|
compdef _add-sshkey add-sshkey
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user