Get rid of one unnecessary local variable.
This commit is contained in:
parent
798bd2328e
commit
b72a0f6e26
@ -1225,7 +1225,7 @@ _known_hosts()
|
|||||||
_known_hosts_real()
|
_known_hosts_real()
|
||||||
{
|
{
|
||||||
local configfile flag prefix
|
local configfile flag prefix
|
||||||
local cur curd awkcur user suffix aliases hosts i host
|
local cur curd awkcur user suffix aliases i host
|
||||||
local -a kh khd config
|
local -a kh khd config
|
||||||
|
|
||||||
local OPTIND=1
|
local OPTIND=1
|
||||||
@ -1347,9 +1347,8 @@ _known_hosts_real()
|
|||||||
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 '"']\{1,\}\([^#*?]*\)\(#.*\)\?$/\2/p' "${config[@]}" )
|
local hosts=$( sed -ne 's/^[ \t]*[Hh][Oo][Ss][Tt]\([Nn][Aa][Mm][Ee]\)\?['"$'\t '"']\{1,\}\([^#*?]*\)\(#.*\)\?$/\2/p' "${config[@]}" )
|
||||||
hosts=$( compgen -W "$host_aliases" -- "$cur" )
|
COMPREPLY=( "${COMPREPLY[@]}" $( compgen -W "$hosts" -- "$cur" ) )
|
||||||
COMPREPLY=( "${COMPREPLY[@]}" $hosts )
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Add hosts reported by avahi, if it's available
|
# Add hosts reported by avahi, if it's available
|
||||||
|
Loading…
x
Reference in New Issue
Block a user