forked from mirror/cobra
Fix handling of descriptions for bash v3 (#1735)
Fixes #1734 Tab characters that introduce completion descriptions weren't properly being handled with bash v3. This change fixes that. Signed-off-by: Marc Khouzam <marc.khouzam@gmail.com>
This commit is contained in:
parent
ed7bb9dda4
commit
7c9831d376
|
@ -219,7 +219,7 @@ __%[1]s_handle_standard_completion_case() {
|
||||||
local tab=$'\t' comp
|
local tab=$'\t' comp
|
||||||
|
|
||||||
# Short circuit to optimize if we don't have descriptions
|
# Short circuit to optimize if we don't have descriptions
|
||||||
if [[ ${completions[*]} != *$tab* ]]; then
|
if [[ "${completions[*]}" != *$tab* ]]; then
|
||||||
IFS=$'\n' read -ra COMPREPLY -d '' < <(compgen -W "${completions[*]}" -- "$cur")
|
IFS=$'\n' read -ra COMPREPLY -d '' < <(compgen -W "${completions[*]}" -- "$cur")
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue