Skip to content
Myr

Fix regression when calling *_custom_func (#1001)

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

PR #889 introduced a regression where the global variable $c is no longer set when *custom_func is called. This is because $c is re-used by mistake in the read loop. This PR simply changes the name of the variable used in the loop.

authored by Marc Khouzam · committed by Joshua Harshman · parent 447f182 · Browse files · 1 file+7 added−6 removed
This commit

State

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

Trailers

  • Signed-off-by: Marc Khouzam <marc.khouzam@gmail.com>

Diff stats

1 file+7 added−6 removed

  • other:+7 added−6 removed

1 file+7 added−6 removed

modified:bash_completions.go+7 added-6 removed
59 unmodified lines
6061__%[1]s_handle_reply()62{63 __%[1]s_debug "${FUNCNAME[0]}"64 local comp65 case $cur in66 -*)67 if [[ $(type -t compopt) = "builtin" ]]; then68 compopt -o nospace
3 unmodified lines
72 allflags=("${must_have_one_flag[@]}")73 else74 allflags=("${flags[*]} ${two_word_flags[*]}")75 fi75 while IFS='' read -r c; do76 COMPREPLY+=("$c")76 while IFS='' read -r comp; do77 COMPREPLY+=("$comp")78 done < <(compgen -W "${allflags[*]}" -- "$cur")79 if [[ $(type -t compopt) = "builtin" ]]; then80 [[ "${COMPREPLY[0]}" == *= ]] || compopt +o nospace81 fi
42 unmodified lines
124 fi125 if [[ ${#must_have_one_flag[@]} -ne 0 ]]; then126 completions+=("${must_have_one_flag[@]}")127 fi127 while IFS='' read -r c; do128 COMPREPLY+=("$c")128 while IFS='' read -r comp; do129 COMPREPLY+=("$comp")130 done < <(compgen -W "${completions[*]}" -- "$cur")131132 if [[ ${#COMPREPLY[@]} -eq 0 && ${#noun_aliases[@]} -gt 0 && ${#must_have_one_noun[@]} -ne 0 ]]; then132 while IFS='' read -r c; do133 COMPREPLY+=("$c")133 while IFS='' read -r comp; do134 COMPREPLY+=("$comp")135 done < <(compgen -W "${noun_aliases[*]}" -- "$cur")136 fi137138 if [[ ${#COMPREPLY[@]} -eq 0 ]]; then
416 unmodified lines