(mount) Make it clear that $' strings are not supported
This commit is contained in:
parent
6e0dc07ee2
commit
c0b77a03f5
@ -26,19 +26,11 @@ _reply_compgen_array()
|
|||||||
# We also have to add another round of escaping to $cur.
|
# We also have to add another round of escaping to $cur.
|
||||||
local ecur="$cur"
|
local ecur="$cur"
|
||||||
ecur="${ecur//\\/\\\\}"
|
ecur="${ecur//\\/\\\\}"
|
||||||
ecur="${ecur/#$\'/\$\'}"
|
|
||||||
|
|
||||||
# Actually generate completions.
|
# Actually generate completions.
|
||||||
local oldifs="$IFS"
|
local oldifs=$IFS
|
||||||
IFS=$'\n' eval 'COMPREPLY=(`compgen -W "$wlist" -- "${ecur}"`)'
|
IFS=$'\n' eval 'COMPREPLY=(`compgen -W "$wlist" -- "${ecur}"`)'
|
||||||
IFS="$oldifs"
|
IFS=$oldifs
|
||||||
|
|
||||||
# Strip starting $' in reply if present in cur.
|
|
||||||
# This is necesarry because readline interprets everything after ' as a
|
|
||||||
# separate word for completion.
|
|
||||||
if [[ $cur == $\'* ]]; then #'
|
|
||||||
COMPREPLY=( "${COMPREPLY[@]/#$\'}" )
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Complete linux fstab entries.
|
# Complete linux fstab entries.
|
||||||
|
@ -76,11 +76,10 @@ sync_after_int
|
|||||||
assert_complete {/mnt/nice\$test-path} {mnt /mnt/nice\$}
|
assert_complete {/mnt/nice\$test-path} {mnt /mnt/nice\$}
|
||||||
sync_after_int
|
sync_after_int
|
||||||
|
|
||||||
assert_complete {$'/mnt/nice-test-path'} {mnt $'/mnt/nice-}
|
# This does not work. Proper support for this requires smarter parsing of
|
||||||
sync_after_int
|
# $COMP_LINE and it's not worth doing just for mount.
|
||||||
|
#assert_complete {$'/mnt/nice\ntest-path'} {mnt $'/mnt/nice\n}
|
||||||
assert_complete {$'/mnt/nice\ntest-path'} {mnt $'/mnt/nice\n}
|
#sync_after_int
|
||||||
sync_after_int
|
|
||||||
|
|
||||||
|
|
||||||
teardown
|
teardown
|
||||||
|
Loading…
x
Reference in New Issue
Block a user