[Bash-completion-commits] [bash-completion] 02/03: lintian: Replace some grep+cuts with awk

Ville Skyttä scop-guest at moszumanska.debian.org
Mon Jan 6 15:48:35 UTC 2014


This is an automated email from the git hooks/post-receive script.

scop-guest pushed a commit to branch master
in repository bash-completion.

commit 93ee00947ae112f195ed368f3414f3622d113630
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Mon Jan 6 17:38:35 2014 +0200

    lintian: Replace some grep+cuts with awk
---
 completions/lintian | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/completions/lintian b/completions/lintian
index 85a91f8..3867c5e 100644
--- a/completions/lintian
+++ b/completions/lintian
@@ -4,7 +4,7 @@ _lintian_tags()
 {
     local match search tags
 
-    tags=$( grep -e ^Tag /usr/share/lintian/checks/*.desc | cut -d\  -f2 )
+    tags=$( awk '/^Tag/ { print $2 }' /usr/share/lintian/checks/*.desc )
     if [[ "$cur" == *, ]]; then
         search=${cur//,/ }
         for item in $search; do
@@ -25,15 +25,14 @@ _lintian_checks()
 {
     local match search todisable checks
 
-    checks=$(grep -e ^Check-Script -e ^Abbrev \
-             /usr/share/lintian/checks/*.desc | cut -d\  -f2 )
+    checks=$( awk '/^(Check-Script|Abbrev)/ { print $2 }' \
+        /usr/share/lintian/checks/*.desc )
     if [[ "$cur" == *, ]]; then
         search=${cur//,/ }
         for item in $search; do
             match=$(grep -nE "^(Check-Script|Abbrev): $item$" \
                     /usr/share/lintian/checks/*.desc | cut -d: -f1 )
-            todisable=$(grep -e ^Check-Script -e ^Abbrev $match | \
-                        cut -d\  -f2 )
+            todisable=$( awk '/^(Check-Script|Abbrev)/ { print $2 }' $match )
             for name in $todisable; do
                 checks=$( sed -e "s/\<$name\>//g" <<<$checks )
             done
@@ -51,8 +50,8 @@ _lintian_infos()
 {
     local match search infos
 
-    infos=$(grep -e ^Collector /usr/share/lintian/collection/*.desc \
-            | cut -d\  -f2 )
+    infos=$( awk '/^Collector/ { print $2 }' \
+        /usr/share/lintian/collection/*.desc )
     if [[ "$cur" == *, ]]; then
         search=${cur//,/ }
         for item in $search; do

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/bash-completion/bash-completion.git



More information about the Bash-completion-commits mailing list