Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update ssh.completion.sh
Browse files Browse the repository at this point in the history
Changed to also read 'hostname' in different cases (but not read HashKnownHosts, HostbasedAcceptedAlgorithms, HostbasedAuthentication or HostKeyAlgorithms like it did before).
jornodberg authored Dec 12, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 751aa43 commit 2c58be7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion completions/ssh.completion.sh
Original file line number Diff line number Diff line change
@@ -45,7 +45,7 @@ function _omb_completion_ssh {
fi
done
if ((${#config_files[@]} != 0)); then
COMPREPLY+=($(compgen -W "$(awk '/^[Hh][Oo][Ss][Tt] /{for (i=2; i<=NF; i++) print $i}' "${config_files[@]}")" "${options[@]}"))
COMPREPLY+=( $(compgen -W "$(awk 'BEGIN {IGNORECASE=1}/^[Hh][Oo][Ss][Tt] / {current_host=""; for (i=2; i<=NF; i++) hosts[current_host=$i]=""}/^[Hh][Oo][Ss][Tt][Nn][Aa][Mm][Ee] / && current_host {hosts[current_host]=$2} END {for (host in hosts) print hosts[host] ? hosts[host] : host}' "${config_files[@]}")" "${options[@]}") )
fi

local -a known_hosts_files=()

0 comments on commit 2c58be7

Please sign in to comment.