Skip to content
Myr

style(bash-v2): out is not an array variable, do not refer to it as such (#1681)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Even though this to my surprise works, it doesn't accomplish anything but some confusion. Remove it.

authored by Ville Skyttä · committed by GitHub · parent 2722a75 · Browse files · 1 file+6 added−6 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+6 added−6 removed

  • other:+6 added−6 removed

1 file+6 added−6 removed

modified:bash_completionsV2.go+6 added-6 removed
76 unmodified lines
77 # There is not directive specified78 directive=079 fi80 __%[1]s_debug "The completion directive is: ${directive}"81 __%[1]s_debug "The completions are: ${out[*]}"81 __%[1]s_debug "The completions are: ${out}"82}8384__%[1]s_process_completion_results() {85 local shellCompDirectiveError=%[3]d
30 unmodified lines
116 local fullFilter filter filteringCmd117118 # Do not use quotes around the $out variable or else newline119 # characters will be kept.120 for filter in ${out[*]}; do120 for filter in ${out}; do121 fullFilter+="$filter|"122 done123124 filteringCmd="_filedir $fullFilter"
3 unmodified lines
128 # File completion for directories only129130 # Use printf to strip any trailing newline131 local subdir132 subdir=$(printf "%%s" "${out[0]}")132 subdir=$(printf "%%s" "${out}")133 if [ -n "$subdir" ]; then134 __%[1]s_debug "Listing directories in $subdir"135 pushd "$subdir" >/dev/null 2>&1 && _filedir -d && popd >/dev/null 2>&1 || return136 else
25 unmodified lines
162 comp=$(compgen -W "$comp" -- "$cur")163 if [ -n "$comp" ]; then164 COMPREPLY+=("$comp")165 fi166 done < <(printf "%%s\n" "${out[@]}")166 done < <(printf "%%s\n" "${out}")167 ;;168169 *)170 # Type: complete (normal completion)
14 unmodified lines
185 comp=$(compgen -W "$comp" -- "$cur")186 if ((${#comp}>longest)); then187 longest=${#comp}188 fi189 done < <(printf "%%s\n" "${out[@]}")189 done < <(printf "%%s\n" "${out}")190191 local completions=()192 while IFS='' read -r comp; do193 if [ -z "$comp" ]; then
3 unmodified lines
197 __%[1]s_debug "Original comp: $comp"198 comp="$(__%[1]s_format_comp_descriptions "$comp" "$longest")"199 __%[1]s_debug "Final comp: $comp"200 completions+=("$comp")201 done < <(printf "%%s\n" "${out[@]}")201 done < <(printf "%%s\n" "${out}")202203 while IFS='' read -r comp; do204 COMPREPLY+=("$comp")205 done < <(compgen -W "${completions[*]}" -- "$cur")
123 unmodified lines