@@ -82,13 +82,13 @@ _{{ .CMDVarName }}()
82
82
__{{ .CMDVarName }}_debug " completions: ${out} "
83
83
__{{ .CMDVarName }}_debug " flagPrefix: ${flagPrefix} "
84
84
85
- if [ $(( directive & shellCompDirectiveError)) -ne 0 ] ; then
85
+ if (( ( directive & shellCompDirectiveError) != 0 )) ; then
86
86
__{{ .CMDVarName }}_debug " Completion received error. Ignoring completions."
87
87
return
88
88
fi
89
89
90
90
while IFS=' \n' read -r comp; do
91
- if [ -n " $comp " ]; then
91
+ if [[ -n $comp ] ]; then
92
92
# If requested, completions are returned with a description.
93
93
# The description is preceded by a TAB character.
94
94
# For zsh's _describe, we need to use a : instead of a TAB.
@@ -104,12 +104,12 @@ _{{ .CMDVarName }}()
104
104
fi
105
105
done < <( printf " %s\n" " ${out[@]} " )
106
106
107
- if [ $(( directive & shellCompDirectiveNoSpace)) -ne 0 ] ; then
107
+ if (( ( directive & shellCompDirectiveNoSpace) != 0 )) ; then
108
108
__{{ .CMDVarName }}_debug " Activating nospace."
109
109
noSpace=" -S ''"
110
110
fi
111
111
112
- if [ $(( directive & shellCompDirectiveFilterFileExt)) -ne 0 ] ; then
112
+ if (( ( directive & shellCompDirectiveFilterFileExt) != 0 )) ; then
113
113
# File extension filtering
114
114
local filteringCmd
115
115
filteringCmd=' _files'
@@ -124,7 +124,7 @@ _{{ .CMDVarName }}()
124
124
125
125
__{{ .CMDVarName }}_debug " File filtering command: $filteringCmd "
126
126
_arguments ' *:filename:' " $filteringCmd "
127
- elif [ $(( directive & shellCompDirectiveFilterDirs)) -ne 0 ] ; then
127
+ elif (( ( directive & shellCompDirectiveFilterDirs) != 0 )) ; then
128
128
# File completion for directories only
129
129
local subdir
130
130
subdir=" ${completions[1]} "
@@ -152,7 +152,7 @@ _{{ .CMDVarName }}()
152
152
else
153
153
__{{ .CMDVarName }}_debug " _describe did not find completions."
154
154
__{{ .CMDVarName }}_debug " Checking if we should do file completion."
155
- if [ $(( directive & shellCompDirectiveNoFileComp)) -ne 0 ] ; then
155
+ if (( ( directive & shellCompDirectiveNoFileComp) != 0 )) ; then
156
156
__{{ .CMDVarName }}_debug " deactivating file completion"
157
157
158
158
# We must return an error code here to let zsh know that there were no
0 commit comments