Corrects the inclusion file list by properly interpreting the paths specified in the Include directive of the ssh_config, aka paths relative to the ~/.ssh folder.
parent
cfa94e70fa
commit
b5f666d467
|
|
@ -15,7 +15,7 @@ _sshcomplete() {
|
||||||
for fl in "$HOME/.ssh/config" \
|
for fl in "$HOME/.ssh/config" \
|
||||||
$(grep "^\s*Include" "$HOME/.ssh/config" |
|
$(grep "^\s*Include" "$HOME/.ssh/config" |
|
||||||
awk '{for (i=2; i<=NF; i++) print $i}' |
|
awk '{for (i=2; i<=NF; i++) print $i}' |
|
||||||
sed "s|^~/|$HOME/|")
|
sed -re "s|^([^/~])|$HOME/.ssh/\1|" -e "s|^~/|$HOME/|")
|
||||||
do
|
do
|
||||||
if [ -r "$fl" ]; then
|
if [ -r "$fl" ]; then
|
||||||
COMPREPLY=( ${COMPREPLY[@]} $(compgen -W "$(grep -i ^Host "$fl" |grep -v '[*!]' | awk '{for (i=2; i<=NF; i++) print $i}' )" ${OPTIONS}) )
|
COMPREPLY=( ${COMPREPLY[@]} $(compgen -W "$(grep -i ^Host "$fl" |grep -v '[*!]' | awk '{for (i=2; i<=NF; i++) print $i}' )" ${OPTIONS}) )
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue