From 7627c4af11d9a4973a3af8e2ad4fb8757ae29bfa Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Thu, 23 Mar 2023 23:00:41 +0900 Subject: [PATCH] fix(bash,bash-v2): avoid process substitutions for the POSIX mode --- bash_completions.go | 8 ++++---- bash_completionsV2.go | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bash_completions.go b/bash_completions.go index 10c78847..d91efde5 100644 --- a/bash_completions.go +++ b/bash_completions.go @@ -162,7 +162,7 @@ __%[1]s_handle_go_custom_completion() else while IFS='' read -r comp; do COMPREPLY+=("$comp") - done < <(compgen -W "${out}" -- "$cur") + done <<< "$(compgen -W "${out}" -- "$cur")" fi } @@ -183,7 +183,7 @@ __%[1]s_handle_reply() fi while IFS='' read -r comp; do COMPREPLY+=("$comp") - done < <(compgen -W "${allflags[*]}" -- "$cur") + done <<< "$(compgen -W "${allflags[*]}" -- "$cur")" if [[ $(type -t compopt) = "builtin" ]]; then [[ "${COMPREPLY[0]}" == *= ]] || compopt +o nospace fi @@ -244,12 +244,12 @@ __%[1]s_handle_reply() fi while IFS='' read -r comp; do 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 while IFS='' read -r comp; do COMPREPLY+=("$comp") - done < <(compgen -W "${noun_aliases[*]}" -- "$cur") + done <<< "$(compgen -W "${noun_aliases[*]}" -- "$cur")" fi if [[ ${#COMPREPLY[@]} -eq 0 ]]; then diff --git a/bash_completionsV2.go b/bash_completionsV2.go index 19b09560..7fdda610 100644 --- a/bash_completionsV2.go +++ b/bash_completionsV2.go @@ -264,7 +264,7 @@ __%[1]s_handle_standard_completion_case() { if ((${#comp}>longest)); then longest=${#comp} fi - done < <(printf "%%s\n" "${completions[@]}") + done <<< "$(printf "%%s\n" "${completions[@]}")" # If there is a single completion left, remove the description text if ((${#COMPREPLY[*]} == 1)); then