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()
81
81
fi
82
82
83
83
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/}" '
89
89
[[ ${COMPREPLY-} == * .class ]] || compopt -o nospace
90
90
91
91
# 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()
18
18
19
19
compopt -o filenames
20
20
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 / } " )
24
23
done
25
- COMPREPLY=(${COMPREPLY[@]% .ko} )
24
+ (( ${# COMPREPLY[@]} )) &&
25
+ COMPREPLY=(" ${COMPREPLY[@]% .ko} " )
26
26
27
27
# also add dirs in current dir
28
28
_comp_compgen -a filedir -d
You can’t perform that action at this time.
0 commit comments