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() {
136136      fi 
137137      ;;
138138    " use" " uninstall" " which" 
139-       if  !  _dvm_has_non_option_parameter
139+       if  !  _dvm_has_non_option_parameter   " $cur " 
140140      then 
141141        if  [ " $command " =  " which" &&  _dvm_has_active_version
142142        then 
@@ -148,7 +148,7 @@ _dvm_completion() {
148148      fi 
149149      ;;
150150    " run" 
151-       if  _dvm_has_non_option_parameter
151+       if  _dvm_has_non_option_parameter  " $cur " 
152152      then 
153153        COMPREPLY=( " $( compgen -W " ${opts} " " ${cur} " ) " 
154154        return 
@@ -158,7 +158,7 @@ _dvm_completion() {
158158      _dvm_add_aliases_to_opts
159159      ;;
160160    " unalias" 
161-       if  [ " $COMP_CWORD " ==  2  ] ||  !  _dvm_has_non_option_parameter
161+       if  [ " $COMP_CWORD " ==  " 2 " ||  !  _dvm_has_non_option_parameter  " $cur " 
162162      then 
163163        _dvm_add_aliases_to_opts
164164      fi 
@@ -181,8 +181,16 @@ _dvm_has_active_version() {
181181
182182#  Checks whether the parameters list have non-option parameter or not.
183183_dvm_has_non_option_parameter () {
184+   local  cur
185+   cur=" $1 " 
186+ 
184187  for  word  in  " ${COMP_WORDS[@]: 2} " 
185188  do 
189+     if  [ " $word " ==  " " ||  [ " $word " ==  " $cur " 
190+     then 
191+       continue 
192+     fi 
193+ 
186194    if  [[ " $word " !=  -*  ]]
187195    then 
188196      true 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments