We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4fc5c89 commit 79ca043Copy full SHA for 79ca043
completions/xdg-mime
@@ -9,17 +9,18 @@ _xdg_mime_mimetype()
9
command cd "$d" 2>/dev/null || exit 1
10
compgen -f -o plusdirs -X "!*.xml" -- "$cur"
11
)) || continue
12
- for i in ${!arr[*]}; do
+ for i in "${!arr[*]}"; do
13
case ${arr[i]} in
14
packages*) unset -v "arr[i]" ;; # not a MIME type dir
15
*.xml) arr[i]=${arr[i]%.xml} ;;
16
*/*) ;;
17
*) arr[i]+=/ ;;
18
esac
19
done
20
- COMPREPLY+=("${arr[@]}")
+ ((${#arr[@]})) &&
21
+ COMPREPLY+=("${arr[@]}")
22
- [[ $COMPREPLY != */ ]] || compopt -o nospace
23
+ [[ ${COMPREPLY-} != */ ]] || compopt -o nospace
24
}
25
26
_xdg_mime()
0 commit comments