Allow `Host(Name)' in ssh config file to have trailing comment.

This commit is contained in:
David Paleino 2008-11-01 12:32:22 +01:00
parent 49437a0f51
commit a893db03d1
2 changed files with 3 additions and 2 deletions

View File

@ -2637,7 +2637,7 @@ _known_hosts()
fi fi
# append any available aliases from config files # append any available aliases from config files
if [ ${#config[@]} -gt 0 ] && [ -n "$aliases" ]; then if [ ${#config[@]} -gt 0 ] && [ -n "$aliases" ]; then
local host_aliases=$( sed -ne 's/^[ \t]*[Hh][Oo][Ss][Tt]\([Nn][Aa][Mm][Ee]\)\?['"$'\t '"']\+\([^*?]*\)$/\2/p' "${config[@]}" ) local host_aliases=$( sed -ne 's/^[ \t]*[Hh][Oo][Ss][Tt]\([Nn][Aa][Mm][Ee]\)\?['"$'\t '"']\+\([^#*?]*\)\(#.*\)\?$/\2/p' "${config[@]}" )
hosts=$( compgen -W "$host_aliases" -- $ocur ) hosts=$( compgen -W "$host_aliases" -- $ocur )
COMPREPLY=( "${COMPREPLY[@]}" $hosts ) COMPREPLY=( "${COMPREPLY[@]}" $hosts )
fi fi

3
debian/changelog vendored
View File

@ -35,9 +35,10 @@ bash-completion (200809xx) UNRELEASED; urgency=low
* Added support for `-F configfile' to _known_hosts(), ssh, scp and * Added support for `-F configfile' to _known_hosts(), ssh, scp and
sftp, thanks to Freddy Vulto (Closes: #504141) sftp, thanks to Freddy Vulto (Closes: #504141)
* Allow `Host(Name)' in ssh config file to be indented * Allow `Host(Name)' in ssh config file to be indented
* Allow `Host(Name)' in ssh config file to have trailing comment.
* debian/links fixed (Closes: #494292) * debian/links fixed (Closes: #494292)
-- David Paleino <d.paleino@gmail.com> Sat, 01 Nov 2008 12:29:14 +0100 -- David Paleino <d.paleino@gmail.com> Sat, 01 Nov 2008 12:31:56 +0100
bash-completion (20080705) unstable; urgency=low bash-completion (20080705) unstable; urgency=low