mirror of
git://git.code.sf.net/p/zsh/code
synced 2024-11-18 21:14:11 +01:00
Fix zrecompile.
This commit is contained in:
parent
6dd5fc9cef
commit
f23e444392
@ -3,6 +3,11 @@
|
||||
* 12728: Completion/User/_man: complete _files instead of
|
||||
manpages if -l or --local-file is present on the commandline.
|
||||
|
||||
2000-09-03 Bart Schaefer <schaefer@zsh.org>
|
||||
|
||||
* 12726,12727: Functions/Misc/zrecompile: Handle pass-through of
|
||||
all zcompile options.
|
||||
|
||||
2000-09-02 Bart Schaefer <schaefer@zsh.org>
|
||||
|
||||
* 12725: Util/helpfiles: Recognize more end-of-page patterns, and
|
||||
|
@ -33,18 +33,26 @@
|
||||
# that needed re-compilation could be compiled and non-zero if compilation
|
||||
# for at least one of the files failed.
|
||||
|
||||
setopt localoptions extendedglob
|
||||
setopt localoptions extendedglob noshwordsplit noksharrays
|
||||
|
||||
local opt check quiet zwc files re file pre ret map tmp mesg pats
|
||||
|
||||
while getopts "tqp" opt; do
|
||||
tmp=()
|
||||
while getopts ":tqp" opt; do
|
||||
case $opt in
|
||||
t) check=yes ;;
|
||||
q) quiet=yes ;;
|
||||
p) pats=yes ;;
|
||||
*)
|
||||
if [[ -n $pats ]]; then
|
||||
tmp=( $tmp $OPTARG )
|
||||
else
|
||||
print -u2 zrecompile: bad option: -$OPTARG
|
||||
return 1
|
||||
fi
|
||||
esac
|
||||
done
|
||||
shift OPTIND-1
|
||||
shift OPTIND-${#tmp:-1}
|
||||
|
||||
if [[ -n $check ]]; then
|
||||
ret=1
|
||||
@ -66,12 +74,16 @@ if [[ -n $pats ]]; then
|
||||
argv=()
|
||||
fi
|
||||
|
||||
if [[ $files[1] = -[RM] ]]; then
|
||||
map=( $files[1] )
|
||||
shift 1 files
|
||||
else
|
||||
map=()
|
||||
fi
|
||||
tmp=()
|
||||
map=()
|
||||
OPTIND=1
|
||||
while getopts :MR opt $files; do
|
||||
case $opt in
|
||||
[MR]) map=( -$opt ) ;;
|
||||
*) tmp=( $tmp $files[OPTIND] );;
|
||||
esac
|
||||
done
|
||||
shift OPTIND-1 files
|
||||
(( $#files )) || continue
|
||||
|
||||
files=( $files[1] ${files[2,-1]:#*(.zwc|~)} )
|
||||
@ -117,7 +129,7 @@ if [[ -n $pats ]]; then
|
||||
# old file by renaming it.
|
||||
|
||||
if { [[ ! -f $zwc ]] || mv $zwc ${zwc}.old } &&
|
||||
zcompile "$map[@]" $zwc $files 2> /dev/null; then
|
||||
zcompile $map $tmp $zwc $files 2> /dev/null; then
|
||||
[[ -z $quiet ]] && print succeeded
|
||||
else
|
||||
[[ -z $quiet ]] && print failed
|
||||
|
Loading…
Reference in New Issue
Block a user