branch: elpa/bash-completion
commit 8270e09294a51f96c77d1475f405d0bfe84955db
Author: Stephane Zermatten <[email protected]>
Commit: Stephane Zermatten <[email protected]>

    pass words as command-line arguments to the function
---
 bash-completion.el      | 2 +-
 bash-completion_test.el | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/bash-completion.el b/bash-completion.el
index 9f1bbd9662..f880c9ee65 100644
--- a/bash-completion.el
+++ b/bash-completion.el
@@ -233,7 +233,7 @@ The result is a list of candidates, which might be empty."
               (setcar function "-F")
               (setcar (cdr function) "__bash_complete_wrapper")
               (format "__BASH_COMPLETE_WRAPPER=%s compgen %s -- %s"
-                      (bash-completion-quote (format "COMP_LINE=%s; 
COMP_POINT=%s; COMP_CWORD=%s; COMP_WORDS=( %s ); %s \"$@\""
+                      (bash-completion-quote (format "COMP_LINE=%s; 
COMP_POINT=%s; COMP_CWORD=%s; COMP_WORDS=( %s ); %s \"${COMP_WORDS[@]}\""
                                                    (bash-completion-quote 
line) pos cword (bash-completion-join words)
                                                    (bash-completion-quote 
function-name)))
                       (bash-completion-join args)
diff --git a/bash-completion_test.el b/bash-completion_test.el
index 046368853c..4c33ea003e 100644
--- a/bash-completion_test.el
+++ b/bash-completion_test.el
@@ -195,13 +195,13 @@ garbage
       (let ((bash-completion-alist '(("zorg" . ("-F" "__zorg"))))
            (default-directory "/test"))
        (bash-completion-generate-line "zorg worl" 7 '("zorg" "worl") 1))
-      "cd /test ; __BASH_COMPLETE_WRAPPER='COMP_LINE='\\''zorg worl'\\''; 
COMP_POINT=7; COMP_CWORD=1; COMP_WORDS=( zorg worl ); __zorg \"$@\"' compgen -F 
__bash_complete_wrapper -- worl")
+      "cd /test ; __BASH_COMPLETE_WRAPPER='COMP_LINE='\\''zorg worl'\\''; 
COMP_POINT=7; COMP_CWORD=1; COMP_WORDS=( zorg worl ); __zorg 
\"${COMP_WORDS[@]}\"' compgen -F __bash_complete_wrapper -- worl")
 
      ("bash-completion-generate-line custom completion command"
       (let ((bash-completion-alist '(("zorg" . ("-C" "__zorg"))))
            (default-directory "/test"))
        (bash-completion-generate-line "zorg worl" 7 '("zorg" "worl") 1))
-      "cd /test ; __BASH_COMPLETE_WRAPPER='COMP_LINE='\\''zorg worl'\\''; 
COMP_POINT=7; COMP_CWORD=1; COMP_WORDS=( zorg worl ); __zorg \"$@\"' compgen -F 
__bash_complete_wrapper -- worl")
+      "cd /test ; __BASH_COMPLETE_WRAPPER='COMP_LINE='\\''zorg worl'\\''; 
COMP_POINT=7; COMP_CWORD=1; COMP_WORDS=( zorg worl ); __zorg 
\"${COMP_WORDS[@]}\"' compgen -F __bash_complete_wrapper -- worl")
 
      ("bash-completion-line-beginning-position start"
       (sz-testutils-with-buffer

Reply via email to