Merge pull request #1474 from damienmascre/contributing

SSH completion : corrects the inclusion file list by properly interpreting the paths s…
This commit is contained in:
Nils Winkler
2020-01-16 12:55:46 +01:00
committed by GitHub

View File

@@ -15,7 +15,7 @@ _sshcomplete() {
for fl in "$HOME/.ssh/config" \
$(grep "^\s*Include" "$HOME/.ssh/config" |
awk '{for (i=2; i<=NF; i++) print $i}' |
sed "s|^~/|$HOME/|")
sed -re "s|^([^/~])|$HOME/.ssh/\1|" -e "s|^~/|$HOME/|")
do
if [ -r "$fl" ]; then
COMPREPLY=( ${COMPREPLY[@]} $(compgen -W "$(grep -i ^Host "$fl" |grep -v '[*!]' | awk '{for (i=2; i<=NF; i++) print $i}' )" ${OPTIONS}) )