- _tar(): use parameter substitution instead of calling tr(1)

This commit is contained in:
ianmacd 2002-06-04 03:27:03 +00:00
parent 835bc25be6
commit fa7f83f272

View File

@ -1,6 +1,6 @@
# bash_completion - some programmable completion functions for bash 2.05a
#
# $Id: bash_completion,v 1.343 2002/06/02 22:19:38 ianmacd Exp $
# $Id: bash_completion,v 1.344 2002/06/04 05:27:03 ianmacd Exp $
#
# Copyright (C) Ian Macdonald <ian@caliban.org>
#
@ -1943,7 +1943,7 @@ _tar()
tar=$( echo "$COMP_LINE" | \
sed -e 's/^.* \([^ ]*'$regex'\) .*$/\1/' )
# devise how to untar and list it
untar=t$( echo ${COMP_WORDS[1]} | tr -cd Izjyf )
untar=t${COMP_WORDS[1]//[^Izjyf]/}
COMPREPLY=( $( compgen -W "$( tar $untar $tar 2>/dev/null )" \
-- "$cur" ) )