Fix mount completion error "bash: [: too many arguments" (Alioth #312381).

This commit is contained in:
Neville Gao 2010-03-04 22:09:35 +02:00 committed by Crestez Dan Leonard
parent cf5e514efb
commit 4632210154
2 changed files with 5 additions and 2 deletions

View File

@ -86,6 +86,9 @@ bash-completion (2.x)
[ Ildar Mulyukov ]
* Add showmount completion (Alioth: #312285).
[ Neville Gao ]
* Fix mount completion error "bash: [: too many arguments" (Alioth #312381).
-- David Paleino <d.paleino@gmail.com> Sun, 11 Oct 2009 11:11:57 +0200
bash-completion (1.1)

View File

@ -111,9 +111,9 @@ _mount()
COMPREPLY=( $( compgen -W "$( mount | awk '! /^[ \t]*#/ {if ($3 ~ /\//) print $3}' )" -- "$cur" ) )
else
# probably Linux
if [ $prev = -L ]; then
if [ "$prev" = -L ]; then
_linux_fstab -L < /etc/fstab
elif [ $prev = -U ]; then
elif [ "$prev" = -U ]; then
COMPREPLY=( $( compgen -W '$(sed -ne "s/^[[:space:]]*UUID=\([^[:space:]]*\).*/\1/p" /etc/fstab )' -- "$cur" ) )
else
_linux_fstab < /etc/fstab