[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 754ee95c1c49d3f7439c3062cbc0a25e736ebf6f

Ville Skyttä ville.skytta at iki.fi
Sun Nov 29 15:17:09 UTC 2009


The following commit has been merged in the master branch:
commit 754ee95c1c49d3f7439c3062cbc0a25e736ebf6f
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Sat Nov 28 23:37:16 2009 +0200

    Drop some unnecessary echos and greps.

diff --git a/contrib/dpkg b/contrib/dpkg
index 4cacd4e..709efc2 100644
--- a/contrib/dpkg
+++ b/contrib/dpkg
@@ -224,7 +224,7 @@ _dpkg_source()
                 "-D")
                     # -D: override or add a .dsc field and value
                     # if $cur doesn't contain a = yet, suggest variable names
-                    if echo -- "$cur" | grep -q "="; then
+                    if [[ "$cur" == *=* ]]; then
                         # $cur contains a "="
                         COMPREPLY=()
                         return 0
diff --git a/contrib/postfix b/contrib/postfix
index e3712aa..0dfd93b 100644
--- a/contrib/postfix
+++ b/contrib/postfix
@@ -182,7 +182,7 @@ _postsuper()
         -[dr])
             len=${#cur}
             idx=0
-            for pval in $( echo ALL; mailq 2>/dev/null | \
+            for pval in ALL $( mailq 2>/dev/null | \
                 sed -e '1d; $d; /^[^0-9A-Z]\|^$/d; s/[* !].*$//' ); do
                 if [[ "$cur" == "${pval:0:$len}" ]]; then
                     COMPREPLY[$idx]=$pval
@@ -194,7 +194,7 @@ _postsuper()
         -h)
             len=${#cur}
             idx=0
-            for pval in $( echo ALL; mailq 2>/dev/null | \
+            for pval in ALL $( mailq 2>/dev/null | \
                 sed -e '1d; $d; /^[^0-9A-Z]\|^$/d; s/[* ].*$//; /!$/d' ); do
                 if [[ "$cur" == "${pval:0:$len}" ]]; then
                     COMPREPLY[$idx]=$pval
@@ -206,7 +206,7 @@ _postsuper()
         -H)
             len=${#cur}
             idx=0
-            for pval in $( echo ALL; mailq 2>/dev/null | \
+            for pval in ALL $( mailq 2>/dev/null | \
                 sed -e '1d; $d; /^[^0-9A-Z]\|^$/d; /^[0-9A-Z]*[* ]/d; s/!.*$//' ); do
                 if [[ "$cur" == "${pval:0:$len}" ]]; then
                     COMPREPLY[$idx]=$pval

-- 
bash-completion



More information about the Bash-completion-commits mailing list