File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -136,7 +136,7 @@ _dvm_completion() {
136
136
fi
137
137
;;
138
138
" use" |" uninstall" |" which" )
139
- if ! _dvm_has_non_option_parameter
139
+ if ! _dvm_has_non_option_parameter " $cur "
140
140
then
141
141
if [ " $command " = " which" ] && _dvm_has_active_version
142
142
then
@@ -148,7 +148,7 @@ _dvm_completion() {
148
148
fi
149
149
;;
150
150
" run" )
151
- if _dvm_has_non_option_parameter
151
+ if _dvm_has_non_option_parameter " $cur "
152
152
then
153
153
COMPREPLY=( " $( compgen -W " ${opts} " -- " ${cur} " ) " )
154
154
return
@@ -158,7 +158,7 @@ _dvm_completion() {
158
158
_dvm_add_aliases_to_opts
159
159
;;
160
160
" unalias" )
161
- if [ " $COMP_CWORD " == 2 ] || ! _dvm_has_non_option_parameter
161
+ if [ " $COMP_CWORD " == " 2 " ] || ! _dvm_has_non_option_parameter " $cur "
162
162
then
163
163
_dvm_add_aliases_to_opts
164
164
fi
@@ -181,8 +181,16 @@ _dvm_has_active_version() {
181
181
182
182
# Checks whether the parameters list have non-option parameter or not.
183
183
_dvm_has_non_option_parameter () {
184
+ local cur
185
+ cur=" $1 "
186
+
184
187
for word in " ${COMP_WORDS[@]: 2} "
185
188
do
189
+ if [ " $word " == " " ] || [ " $word " == " $cur " ]
190
+ then
191
+ continue
192
+ fi
193
+
186
194
if [[ " $word " != -* ]]
187
195
then
188
196
true
You can’t perform that action at this time.
0 commit comments