fix(bash,bash-v2): avoid process substitutions for the POSIX mode

This commit is contained in:
Koichi Murase 2023-03-23 23:00:41 +09:00
parent 4dd4b25de3
commit 7627c4af11
2 changed files with 5 additions and 5 deletions

View file

@ -162,7 +162,7 @@ __%[1]s_handle_go_custom_completion()
else else
while IFS='' read -r comp; do while IFS='' read -r comp; do
COMPREPLY+=("$comp") COMPREPLY+=("$comp")
done < <(compgen -W "${out}" -- "$cur") done <<< "$(compgen -W "${out}" -- "$cur")"
fi fi
} }
@ -183,7 +183,7 @@ __%[1]s_handle_reply()
fi fi
while IFS='' read -r comp; do while IFS='' read -r comp; do
COMPREPLY+=("$comp") COMPREPLY+=("$comp")
done < <(compgen -W "${allflags[*]}" -- "$cur") done <<< "$(compgen -W "${allflags[*]}" -- "$cur")"
if [[ $(type -t compopt) = "builtin" ]]; then if [[ $(type -t compopt) = "builtin" ]]; then
[[ "${COMPREPLY[0]}" == *= ]] || compopt +o nospace [[ "${COMPREPLY[0]}" == *= ]] || compopt +o nospace
fi fi
@ -244,12 +244,12 @@ __%[1]s_handle_reply()
fi fi
while IFS='' read -r comp; do while IFS='' read -r comp; do
COMPREPLY+=("$comp") COMPREPLY+=("$comp")
done < <(compgen -W "${completions[*]}" -- "$cur") done <<< "$(compgen -W "${completions[*]}" -- "$cur")"
if [[ ${#COMPREPLY[@]} -eq 0 && ${#noun_aliases[@]} -gt 0 && ${#must_have_one_noun[@]} -ne 0 ]]; then if [[ ${#COMPREPLY[@]} -eq 0 && ${#noun_aliases[@]} -gt 0 && ${#must_have_one_noun[@]} -ne 0 ]]; then
while IFS='' read -r comp; do while IFS='' read -r comp; do
COMPREPLY+=("$comp") COMPREPLY+=("$comp")
done < <(compgen -W "${noun_aliases[*]}" -- "$cur") done <<< "$(compgen -W "${noun_aliases[*]}" -- "$cur")"
fi fi
if [[ ${#COMPREPLY[@]} -eq 0 ]]; then if [[ ${#COMPREPLY[@]} -eq 0 ]]; then

View file

@ -264,7 +264,7 @@ __%[1]s_handle_standard_completion_case() {
if ((${#comp}>longest)); then if ((${#comp}>longest)); then
longest=${#comp} longest=${#comp}
fi fi
done < <(printf "%%s\n" "${completions[@]}") done <<< "$(printf "%%s\n" "${completions[@]}")"
# If there is a single completion left, remove the description text # If there is a single completion left, remove the description text
if ((${#COMPREPLY[*]} == 1)); then if ((${#COMPREPLY[*]} == 1)); then