Avoid some unnecessary commands.

This commit is contained in:
Ville Skyttä 2011-04-26 00:21:55 +03:00
parent f48d6fb10d
commit e35eabb791
2 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -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"
}