@@ -72,7 +72,9 @@ __%[1]s_handle_reply()
72
72
else
73
73
allflags=("${flags[*]} ${two_word_flags[*]}")
74
74
fi
75
- COMPREPLY=( $(compgen -W "${allflags[*]}" -- "$cur") )
75
+ while IFS='' read -r c; do
76
+ COMPREPLY+=("$c")
77
+ done < <(compgen -W "${allflags[*]}" -- "$cur")
76
78
if [[ $(type -t compopt) = "builtin" ]]; then
77
79
[[ "${COMPREPLY[0]}" == *= ]] || compopt +o nospace
78
80
fi
@@ -122,10 +124,14 @@ __%[1]s_handle_reply()
122
124
if [[ ${#must_have_one_flag[@]} -ne 0 ]]; then
123
125
completions+=("${must_have_one_flag[@]}")
124
126
fi
125
- COMPREPLY=( $(compgen -W "${completions[*]}" -- "$cur") )
127
+ while IFS='' read -r c; do
128
+ COMPREPLY+=("$c")
129
+ done < <(compgen -W "${completions[*]}" -- "$cur")
126
130
127
131
if [[ ${#COMPREPLY[@]} -eq 0 && ${#noun_aliases[@]} -gt 0 && ${#must_have_one_noun[@]} -ne 0 ]]; then
128
- COMPREPLY=( $(compgen -W "${noun_aliases[*]}" -- "$cur") )
132
+ while IFS='' read -r c; do
133
+ COMPREPLY+=("$c")
134
+ done < <(compgen -W "${noun_aliases[*]}" -- "$cur")
129
135
fi
130
136
131
137
if [[ ${#COMPREPLY[@]} -eq 0 ]]; then
@@ -160,7 +166,7 @@ __%[1]s_handle_filename_extension_flag()
160
166
__%[1]s_handle_subdirs_in_dir_flag()
161
167
{
162
168
local dir="$1"
163
- pushd "${dir}" >/dev/null 2>&1 && _filedir -d && popd >/dev/null 2>&1
169
+ pushd "${dir}" >/dev/null 2>&1 && _filedir -d && popd >/dev/null 2>&1 || return
164
170
}
165
171
166
172
__%[1]s_handle_flag()
0 commit comments