From f0f3c02a3ccde07d3dc79577c7eca41ea3e8e86f Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Fri, 2 Apr 2010 11:32:38 +0200 Subject: Replace $var by ${var} --- etc/completions/_sshfs | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'etc/completions/_sshfs') diff --git a/etc/completions/_sshfs b/etc/completions/_sshfs index e4e6aa7..b0adbaa 100644 --- a/etc/completions/_sshfs +++ b/etc/completions/_sshfs @@ -12,11 +12,11 @@ _remote_files () { if zstyle -T ":completion:${curcontext}:files" remote-access; then zparseopts -D -E -a args p: 1 2 4 6 F: - if [[ -z $QIPREFIX ]] + if [[ -z ${QIPREFIX} ]] then rempat="${PREFIX%%[^./][^/]#}\*" else rempat="${(q)PREFIX%%[^./][^/]#}\*" fi - remfiles=(${(M)${(f)"$(_call_program files ssh -o BatchMode=yes $args -a -x ${IPREFIX%:} ls -d1FL "$rempat" 2>/dev/null)"}%%[^/]#(|/)}) + remfiles=(${(M)${(f)"$(_call_program files ssh -o BatchMode=yes ${args} -a -x ${IPREFIX%:} ls -d1FL "${rempat}" 2>/dev/null)"}%%[^/]#(|/)}) compset -P '*/' compset -S '/*' || suf='remote file' @@ -26,9 +26,9 @@ _remote_files () { _tags files while _tags; do while _next_label files expl ${suf:-remote directory}; do - [[ -n $suf ]] && compadd "$@" "$expl[@]" -d remdispf \ + [[ -n ${suf} ]] && compadd "${@}" "${expl[@]}" -d remdispf \ ${(q)remdispf%[*=@|]} && ret=0 - compadd ${suf:+-S/} "$@" "$expl[@]" -d remdispd \ + compadd ${suf:+-S/} "${@}" "${expl[@]}" -d remdispd \ ${(q)remdispd%/} && ret=0 done (( ret )) || return 0 @@ -53,7 +53,7 @@ _arguments \ ':mountpoint:_files -/' _ssh_users () { - _combination -s '[:@]' my-accounts users-hosts users "$@" + _combination -s '[:@]' my-accounts users-hosts users "${@}" } _ssh_hosts () { @@ -62,40 +62,40 @@ _ssh_hosts () { integer ind # If users-hosts matches, we shouldn't complete anything else. - if [[ "$IPREFIX" == *@ ]]; then - _combination -s '[:@]' my-accounts users-hosts "users=${IPREFIX/@}" hosts "$@" && return + if [[ "${IPREFIX}" == *@ ]]; then + _combination -s '[:@]' my-accounts users-hosts "users=${IPREFIX/@}" hosts "${@}" && return else _combination -s '[:@]' my-accounts users-hosts \ - ${opt_args[-l]:+"users=${opt_args[-l]:q}"} hosts "$@" && return + ${opt_args[-l]:+"users=${opt_args[-l]:q}"} hosts "${@}" && return fi if (( ind = ${words[(I)-F]} )); then config=${~words[ind+1]} else - config="$HOME/.ssh/config" + config="${HOME}/.ssh/config" fi - if [[ -r $config ]]; then + if [[ -r ${config} ]]; then local IFS=$'\t ' key hosts host while read key hosts; do - if [[ "$key" == (#i)host ]]; then + if [[ "${key}" == (#i)host ]]; then for host in ${(z)hosts}; do - case $host in + case ${host} in (*[*?]*) ;; - (*) config_hosts+=("$host") ;; + (*) config_hosts+=("${host}") ;; esac done fi - done < "$config" + done < "${config}" if (( ${#config_hosts} )); then _wanted hosts expl 'remote host name' \ - compadd -M 'm:{a-zA-Z}={A-Za-z} r:|.=* r:|=*' "$@" $config_hosts + compadd -M 'm:{a-zA-Z}={A-Za-z} r:|.=* r:|=*' "${@}" ${config_hosts} fi fi } -while [[ -n $state ]]; do - lstate=$state +while [[ -n ${state} ]]; do + lstate=${state} state='' - case $lstate in + case ${lstate} in userhost) if compset -P '*:'; then _remote_files ${(kv)~opt_args[(I)-[FP1246]]/-P/-p} && ret=0 @@ -111,7 +111,7 @@ while [[ -n $state ]]; do fi _alternative \ 'hosts:remote host name:_ssh_hosts -S :' \ - "$tmp[@]" + "${tmp[@]}" fi ;; esac -- cgit v1.2.3