[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 1.90-118-g3ccfe02

Ville Skyttä ville.skytta at iki.fi
Sun Jan 1 12:57:53 UTC 2012


The following commit has been merged in the master branch:
commit d4416accccb7be5efa8690a3e703ad91a6c02eac
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Sun Jan 1 14:42:39 2012 +0200

    _filedir, _tilde: Ignore compopt stderr for direct invocations in unit tests.

diff --git a/bash_completion b/bash_completion
index da0267b..99addfd 100644
--- a/bash_completion
+++ b/bash_completion
@@ -590,7 +590,8 @@ _filedir()
         -n "$1" && "$1" != -d && ${#toks[@]} -lt 1 ]] && \
         toks+=( $( compgen -f -- $quoted ) )
 
-    [[ ${#toks[@]} -ne 0 ]] && compopt -o filenames
+    # 2>/dev/null for direct invocation, e.g. in the _filedir unit test
+    [[ ${#toks[@]} -ne 0 ]] && compopt -o filenames 2>/dev/null
 
     COMPREPLY+=( "${toks[@]}" )
 } # _filedir()
@@ -923,7 +924,8 @@ _tilde()
         # Try generate ~username completions
         COMPREPLY=( $( compgen -P '~' -u "${1#\~}" ) )
         result=${#COMPREPLY[@]}
-        [[ $result -gt 0 ]] && compopt -o filenames
+        # 2>/dev/null for direct invocation, e.g. in the _tilde unit test
+        [[ $result -gt 0 ]] && compopt -o filenames 2>/dev/null
     fi
     return $result
 }

-- 
bash-completion



More information about the Bash-completion-commits mailing list