From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3899 invoked from network); 3 Sep 2000 21:22:16 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 3 Sep 2000 21:22:16 -0000 Received: (qmail 2517 invoked by alias); 3 Sep 2000 21:21:44 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 12727 Received: (qmail 2487 invoked from network); 3 Sep 2000 21:21:07 -0000 From: "Bart Schaefer" Message-Id: <1000903212035.ZM30911@candle.brasslantern.com> Date: Sun, 3 Sep 2000 21:20:35 +0000 In-Reply-To: <1000903201905.ZM30766@candle.brasslantern.com> Comments: In reply to "Bart Schaefer" "PATCH: Tiny fix to zrecompile" (Sep 3, 8:19pm) References: <1000903201905.ZM30766@candle.brasslantern.com> X-Mailer: Z-Mail (5.0.0 30July97) To: zsh-workers@sunsite.auc.dk Subject: Re: PATCH: Tiny fix to zrecompile MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Sep 3, 8:19pm, Bart Schaefer wrote: } Subject: PATCH: Tiny fix to zrecompile } } The -p option didn't work properly when the first word after it was an } option for the zcompile command; getopts would fail with "bad option". I just realized that this patch didn't go far enough. The following is a slight reworking to cause zrecompile to pass along any/all zcompile options that may appear after -p. Apply it after 12726. --- zsh-forge/current/Functions/Misc/zrecompile Sun Sep 3 14:02:19 2000 +++ zsh-3.1.9-dev-5/Functions/Misc/zrecompile Sun Sep 3 14:18:50 2000 @@ -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 +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 @@ 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 @@ # 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 -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net