diff options
author | Crestez Dan Leonard <cdleonard@gmail.com> | 2010-02-08 08:35:46 +0200 |
---|---|---|
committer | Crestez Dan Leonard <cdleonard@gmail.com> | 2010-02-09 15:28:28 +0200 |
commit | c0b77a03f55f06fc9a00b766307335574cc79293 (patch) | |
tree | 36b17f2331c132204e4a29133f7dce673384dc87 | |
parent | 6e0dc07ee25ad9ab617ee8f5d2e861c8ef29d8bd (diff) | |
download | bash-completion-c0b77a03f55f06fc9a00b766307335574cc79293.tar.gz |
(mount) Make it clear that $' strings are not supported
-rw-r--r-- | contrib/mount | 12 | ||||
-rw-r--r-- | test/lib/completions/mount.exp | 9 |
2 files changed, 6 insertions, 15 deletions
diff --git a/contrib/mount b/contrib/mount index bfa2a273..6c94e3f9 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 74022371..ddeadab5 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 |