Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Needed getopts repairs



In zsh-workers/8757 I wrote:
} 
} function oops() {
}     while getopts :m: f
}     do
}         echo $OPTIND is $f with $OPTARG
}         shift $((OPTIND - 1))
}     done
} }
} 
} 3.0.7 gives:
} 
} zagzig% oops -m 0664 something
} 3 is m with 0664
} zagzig% 
} 
} 3.1.6-pws-9 gives:
} 
} zagzig% oops -m 0664 something 
} 2 is m with 0664
} 2 is ? with t
} zagzig% 
} 
} There are two problems here: (1) OPTIND is different. (2) Parsing didn't
} stop soon enough; it should have returned nonzero once -m was shifted off.

According to

    http://www.cs.princeton.edu/~jlk/kornshell/doc/man93.html#Built-in

the ksh93 implementation of OPTIND corresponds to the zsh 3.0 behavior,
and not to the 3.1 behavior.

I had hoped to produce a patch for this before going off-line for the
holidays, but I didn't get to it.  I'll try again in January if no one
else does it first.

Meanwhile, best wishes to you all, and don't let the Y2K bugs bite.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



Messages sorted by: Reverse Date, Date, Thread, Author