summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVille Skyttä <ville.skytta@iki.fi>2012-01-01 14:42:39 +0200
committerVille Skyttä <ville.skytta@iki.fi>2012-01-01 14:42:39 +0200
commitd4416accccb7be5efa8690a3e703ad91a6c02eac (patch)
treeb7b1ae87bc62ddebe2c0659201fae69c00c902dc
parent5882061fec512fc3a61f9a668c225b0e3c3cce90 (diff)
downloadbash-completion-d4416accccb7be5efa8690a3e703ad91a6c02eac.tar.gz
_filedir, _tilde: Ignore compopt stderr for direct invocations in unit tests.
-rw-r--r--bash_completion6
1 files changed, 4 insertions, 2 deletions
diff --git a/bash_completion b/bash_completion
index da0267b9..99addfd2 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
}