Code cleanups, indentation and line wrapping fixes, comment improvements.

This commit is contained in:
Ville Skyttä 2009-11-28 12:36:32 +02:00
parent c948a3d411
commit 97e3778cb2

View File

@ -6,20 +6,18 @@ have ssh &&
_ssh_options() { _ssh_options() {
COMPREPLY=( $( compgen -W 'AddressFamily BatchMode BindAddress \ COMPREPLY=( $( compgen -W 'AddressFamily BatchMode BindAddress \
ChallengeResponseAuthentication CheckHostIP Cipher Ciphers \ ChallengeResponseAuthentication CheckHostIP Cipher Ciphers \
ClearAllForwardings Compression CompressionLevel \ ClearAllForwardings Compression CompressionLevel ConnectionAttempts \
ConnectionAttempts ConnectTimeout ControlMaster ControlPath \ ConnectTimeout ControlMaster ControlPath DynamicForward EscapeChar \
DynamicForward EscapeChar ExitOnForwardFailure ForwardAgent \ ExitOnForwardFailure ForwardAgent ForwardX11 ForwardX11Trusted \
ForwardX11 ForwardX11Trusted GatewayPorts GlobalKnownHostsFile \ GatewayPorts GlobalKnownHostsFile GSSAPIAuthentication \
GSSAPIAuthentication GSSAPIDelegateCredentials HashKnownHosts \ GSSAPIDelegateCredentials HashKnownHosts Host HostbasedAuthentication \
Host HostbasedAuthentication HostKeyAlgorithms HostKeyAlias \ HostKeyAlgorithms HostKeyAlias HostName IdentityFile IdentitiesOnly \
HostName IdentityFile IdentitiesOnly KbdInteractiveDevices \ KbdInteractiveDevices LocalCommand LocalForward LogLevel MACs \
LocalCommand LocalForward LogLevel MACs \
NoHostAuthenticationForLocalhost NumberOfPasswordPrompts \ NoHostAuthenticationForLocalhost NumberOfPasswordPrompts \
PasswordAuthentication PermitLocalCommand Port \ PasswordAuthentication PermitLocalCommand Port \
PreferredAuthentications Protocol ProxyCommand \ PreferredAuthentications Protocol ProxyCommand PubkeyAuthentication \
PubkeyAuthentication RekeyLimit RemoteForward \ RekeyLimit RemoteForward RhostsRSAAuthentication RSAAuthentication \
RhostsRSAAuthentication RSAAuthentication SendEnv \ SendEnv ServerAliveInterval ServerAliveCountMax SmartcardDevice \
ServerAliveInterval ServerAliveCountMax SmartcardDevice \
StrictHostKeyChecking TCPKeepAlive Tunnel TunnelDevice \ StrictHostKeyChecking TCPKeepAlive Tunnel TunnelDevice \
UsePrivilegedPort User UserKnownHostsFile VerifyHostKeyDNS \ UsePrivilegedPort User UserKnownHostsFile VerifyHostKeyDNS \
VisualHostKey XAuthLocation' -- "$cur" ) ) VisualHostKey XAuthLocation' -- "$cur" ) )
@ -40,16 +38,14 @@ _ssh()
return 0 return 0
;; ;;
-c) -c)
COMPREPLY=( $( compgen -W '3des-cbc aes128-cbc \ COMPREPLY=( $( compgen -W '3des-cbc aes128-cbc aes192-cbc \
aes192-cbc aes256-cbc aes128-ctr aes192-ctr \ aes256-cbc aes128-ctr aes192-ctr aes256-ctr arcfour128 \
aes256-ctr arcfour128 arcfour256 arcfour \ arcfour256 arcfour blowfish-cbc cast128-cbc' -- "$cur" ) )
blowfish-cbc cast128-cbc' -- "$cur" ) )
return 0 return 0
;; ;;
-c) -c)
COMPREPLY=( $( compgen -W 'hmac-md5 hmac-sha1 \ COMPREPLY=( $( compgen -W 'hmac-md5 hmac-sha1 umac-64@openssh.com \
umac-64@openssh.com hmac-ripemd160 \ hmac-ripemd160 hmac-sha1-96 hmac-md5-96' -- "$cur" ) )
hmac-sha1-96 hmac-md5-96' -- "$cur" ) )
return 0 return 0
;; ;;
-l) -l)
@ -175,7 +171,7 @@ _scp()
if [[ "$cur" == *:* ]]; then if [[ "$cur" == *:* ]]; then
local IFS=$'\t\n' local IFS=$'\t\n'
# remove backslash escape from : # remove backslash escape from the first colon
cur=${cur/\\:/:} cur=${cur/\\:/:}
userhost=${cur%%?(\\):*} userhost=${cur%%?(\\):*}
path=${cur#*:} path=${cur#*:}
@ -189,8 +185,7 @@ _scp()
# add space at end of file names # add space at end of file names
COMPREPLY=( $( ssh -o 'Batchmode yes' $userhost \ COMPREPLY=( $( ssh -o 'Batchmode yes' $userhost \
command ls -aF1d "$path*" 2>/dev/null | \ command ls -aF1d "$path*" 2>/dev/null | \
sed -e "s/$esc/\\\\\\\\\\\\&/g" \ sed -e 's/'$esc'/\\\\\\&/g' -e 's/[*@|=]$//g' -e 's/[^\/]$/& /g' ) )
-e 's/[*@|=]$//g' -e 's/[^\/]$/& /g' ) )
return 0 return 0
fi fi
@ -218,9 +213,9 @@ _scp()
# This approach is used instead of _filedir to get a space appended # This approach is used instead of _filedir to get a space appended
# after local file/dir completions, and -o nospace retained for others. # after local file/dir completions, and -o nospace retained for others.
local IFS=$'\t\n' local IFS=$'\t\n'
COMPREPLY=( "${COMPREPLY[@]}" $( command ls -aF1d $cur* 2>/dev/null | sed \ COMPREPLY=( "${COMPREPLY[@]}" $( command ls -aF1d $cur* 2>/dev/null | \
-e "s/$esc/\\\\&/g" \ sed -e "s/$esc/\\\\&/g" -e 's/[*@|=]$//g' -e 's/[^\/]$/& /g' \
-e 's/[*@|=]$//g' -e 's/[^\/]$/& /g' -e "s/^/$prefix/") ) -e "s/^/$prefix/") )
return 0 return 0
} }