[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 1.3-126-ge35eabb

Ville Skyttä ville.skytta at iki.fi
Tue Apr 26 08:02:38 UTC 2011


The following commit has been merged in the master branch:
commit e35eabb791733996078aae9161fc01ab5f94a9e3
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Tue Apr 26 00:21:55 2011 +0300

    Avoid some unnecessary commands.

diff --git a/completions/ant b/completions/ant
index d1ee16e..273c103 100644
--- a/completions/ant
+++ b/completions/ant
@@ -50,10 +50,10 @@ _ant()
         # parse buildfile for targets
         # some versions of sed complain if there's no trailing linefeed,
         # hence the 2>/dev/null
-        COMPREPLY=( $( compgen -W "$( cat $buildfile | tr "'\t\n>" "\"  \n" | \
+        COMPREPLY=( $( compgen -W "$( tr "'\t\n>" "\"  \n" < $buildfile | \
             sed -ne 's/.*<target .*name="\([^"]*\).*/\1/p' 2>/dev/null )" \
             -- "$cur" ) )
-        fi
+    fi
 } &&
 have complete-ant-cmd.pl && \
      complete -C complete-ant-cmd.pl -F _ant ant || complete -F _ant ant
diff --git a/completions/cvs b/completions/cvs
index 0623b3f..07b681f 100644
--- a/completions/cvs
+++ b/completions/cvs
@@ -50,7 +50,7 @@ _cvs_roots()
     cvsroots=( $CVSROOT )
     [ -r ~/.cvspass ] && \
         cvsroots+=( $( awk '{ print $2 }' ~/.cvspass ) )
-    [ -r CVS/Root ] && cvsroots+=( $( cat CVS/Root ) )
+    [ -r CVS/Root ] && mapfile -tO ${#cvsroots[@]} cvsroots < CVS/Root
     COMPREPLY=( $( compgen -W '${cvsroots[@]}' -- "$cur" ) )
     __ltrim_colon_completions "$cur"
 }

-- 
bash-completion



More information about the Bash-completion-commits mailing list