[pacman-dev] [PATCH] bash_completion: negate expression inside brackets
Dave Reisner
d at falconindy.com
Mon Jul 26 10:49:43 EDT 2010
Avoids letting the shell evaluate ! as something else (e.g. an alias).
Signed-off-by: Dave Reisner <d at falconindy.com>
---
contrib/bash_completion | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/contrib/bash_completion b/contrib/bash_completion
index 1ec2cd5..bdc4754 100644
--- a/contrib/bash_completion
+++ b/contrib/bash_completion
@@ -75,8 +75,8 @@ _pacman() {
if [[ $? != 0 ]]; then
_arch_ptr2comp core
- elif ! [[ $prev =~ ^-\w*[Vbhr] ||
- $prev = --@(cachedir|config|dbpath|help|logfile|root|version) ]]
+ elif [[ ! $prev =~ ^-\w*[Vbhr] &&
+ ! $prev = --@(cachedir|config|dbpath|help|logfile|root|version) ]]
then
[[ $cur = -* ]] && _arch_ptr2comp ${o#* } common ||
case ${o% *} in
--
1.7.2
More information about the pacman-dev
mailing list