@@ -8,23 +8,24 @@ _comp_cmd_mount()
88 local cur prev words cword comp_args
99 _comp_initialize -n =: -- " $@ " || return
1010
11- local split=false
11+ local split=" "
1212 case " $prev " in
1313 -t | --types)
1414 # find /lib/modules/$(uname -r)/ -type f -path '*/fs/*.ko' -printf '%f\n' | cut -d. -f1
1515 # FIXME: no<fstype>
1616 if [[ $cur == ?* ,* ]]; then
1717 prev=" ${cur% ,* } "
1818 cur=" ${cur##* ,} "
19- split=true
19+ # shellcheck disable=SC2209
20+ split=set
2021 fi
2122 COMPREPLY=($( compgen -W ' auto adfs affs autofs btrfs cifs coda
2223 cramfs davfs debugfs devpts efs ext2 ext3 ext4 fuse hfs hfsplus
2324 hpfs iso9660 jffs2 jfs minix msdos ncpfs nfs nfs4 ntfs ntfs-3g
2425 proc qnx4 ramfs reiserfs romfs squashfs smbfs sysv tmpfs ubifs
2526 udf ufs umsdos usbfs vfat xfs' -- " $cur " ) )
2627 _fstypes
27- $split && COMPREPLY=(${COMPREPLY[@]/#/ $prev ,} )
28+ [[ $split ]] && COMPREPLY=(${COMPREPLY[@]/#/ $prev ,} )
2829 return
2930 ;;
3031 --bind | -B | --rbind | -R)
@@ -74,7 +75,8 @@ _comp_cmd_mount()
7475 if [[ $cur == ?* ,* ]]; then
7576 prev=" ${cur% ,* } "
7677 cur=" ${cur##* ,} "
77- split=true
78+ # shellcheck disable=SC2209
79+ split=set
7880 fi
7981 # no completion if $cur is opt=smth
8082 [[ $cur == * = * ]] && return
@@ -206,7 +208,7 @@ _comp_cmd_mount()
206208 esac
207209 # COMP_WORDBREAKS is a real pain in the ass
208210 prev=" ${prev##* ["$COMP_WORDBREAKS"]} "
209- $split && COMPREPLY=(${COMPREPLY[@]/#/ " $prev ," } )
211+ [[ $split ]] && COMPREPLY=(${COMPREPLY[@]/#/ " $prev ," } )
210212 [[ ${COMPREPLY-} == * = ]] && compopt -o nospace
211213 return
212214 ;;
0 commit comments