mirror of
https://github.com/spf13/cobra
synced 2024-12-26 22:37:08 +00:00
fix(bash,bash-v2): avoid process substitutions for the POSIX mode
This commit is contained in:
parent
4dd4b25de3
commit
7627c4af11
2 changed files with 5 additions and 5 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue