File tree Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -81,11 +81,11 @@ _comp_cmd_java__classes()
8181 fi
8282
8383 elif [[ -d $i ]]; then
84- COMPREPLY+=(
85- $( compgen -d -- " $i /$cur " | command sed -e " s|^ $i /\(.*\)|\1.| " )
86- $( compgen - f -X ' !*.class' -- " $i / $cur " |
87- command sed -e ' /\$/d ' -e " s|^ $i /|| " )
88- )
84+ local tmp
85+ _comp_compgen -v tmp -c " $i /$cur " -- -d -S .
86+ _comp_compgen -av tmp -c " $i / $cur " -- - f -X ' !*.class'
87+ (( ${ # tmp[@]} )) &&
88+ _comp_compgen -a -- -X ' *\$* ' -W ' "${tmp[@]#$i/}" '
8989 [[ ${COMPREPLY-} == * .class ]] || compopt -o nospace
9090
9191 # FIXME: if we have foo.class and foo/, the completion
Original file line number Diff line number Diff line change @@ -18,11 +18,11 @@ _comp_cmd_kldload()
1818
1919 compopt -o filenames
2020 for i in " ${moddirs[@]} " ; do
21- modules=($( compgen -f " $i /$cur " ) )
22- modules=(${modules[@]# $i / } )
23- COMPREPLY+=(" ${modules[@]} " )
21+ _comp_compgen -v modules -c " $i /$cur " -- -f &&
22+ COMPREPLY+=(" ${modules[@]# $i / } " )
2423 done
25- COMPREPLY=(${COMPREPLY[@]% .ko} )
24+ (( ${# COMPREPLY[@]} )) &&
25+ COMPREPLY=(" ${COMPREPLY[@]% .ko} " )
2626
2727 # also add dirs in current dir
2828 _comp_compgen -a filedir -d
You can’t perform that action at this time.
0 commit comments