[Bash-completion-commits] [SCM] bash-completion branch, mount-fix, updated. 4375c4b94ea7bdd370cd771aeb3483f36a42bd9f
Crestez Dan Leonard
cdleonard at gmail.com
Tue Feb 9 13:45:10 UTC 2010
The following commit has been merged in the mount-fix branch:
commit c0b77a03f55f06fc9a00b766307335574cc79293
Author: Crestez Dan Leonard <cdleonard at gmail.com>
Date: Mon Feb 8 08:35:46 2010 +0200
(mount) Make it clear that $' strings are not supported
diff --git a/contrib/mount b/contrib/mount
index bfa2a27..6c94e3f 100644
--- a/contrib/mount
+++ b/contrib/mount
@@ -26,19 +26,11 @@ _reply_compgen_array()
# We also have to add another round of escaping to $cur.
local ecur="$cur"
ecur="${ecur//\\/\\\\}"
- ecur="${ecur/#$\'/\$\'}"
# Actually generate completions.
- local oldifs="$IFS"
+ local oldifs=$IFS
IFS=$'\n' eval 'COMPREPLY=(`compgen -W "$wlist" -- "${ecur}"`)'
- 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
+ IFS=$oldifs
}
# Complete linux fstab entries.
diff --git a/test/lib/completions/mount.exp b/test/lib/completions/mount.exp
index 7402237..ddeadab 100644
--- a/test/lib/completions/mount.exp
+++ b/test/lib/completions/mount.exp
@@ -76,11 +76,10 @@ sync_after_int
assert_complete {/mnt/nice\$test-path} {mnt /mnt/nice\$}
sync_after_int
-assert_complete {$'/mnt/nice-test-path'} {mnt $'/mnt/nice-}
-sync_after_int
-
-assert_complete {$'/mnt/nice\ntest-path'} {mnt $'/mnt/nice\n}
-sync_after_int
+# This does not work. Proper support for this requires smarter parsing of
+# $COMP_LINE and it's not worth doing just for mount.
+#assert_complete {$'/mnt/nice\ntest-path'} {mnt $'/mnt/nice\n}
+#sync_after_int
teardown
--
bash-completion
More information about the Bash-completion-commits
mailing list