On Fri, Nov 02, 2007 at 07:28:30AM +0000, Jakub Narebski wrote: > Jakub Narebski wrote: > > Petr Baudis wrote: > > > On Fri, Nov 02, 2007 at 01:04:03AM +0100, Jakub Narebski wrote: > > > > >> Is 'getopts' bash-ism, or is it in POSIX? > > > > > > http://www.opengroup.org/onlinepubs/009695399/utilities/getopts.html > > > > > > (Also, most modern distributions have manpage section 1p (3p, ...) with > > > the same contents, so you can check for this stuff pretty easily.) > > > > Thanks. > > > > I have just realized however that it doesn't help any (option parser > > not only for C builtin, but also for shell scripts, Perl scripts and > > Python scripts). First, we (the git development community) do not > > consider fact that something is in POSIX as indicator that we can use > > the construct. Second, getopts delas IIRC only with _short_ options. > > Just a thought: > http://www.systhread.net/texts/200704optparse.php Well, I'm sure we could probably do the same with our own `git-parseopt` tool, couldn't we ? I'll try to give it a shot, and it'll have all the features shell-script currently have at great costs of code length (like the lazy way to type long options: -q|--q|--qu|--qui|...) -- ·O· Pierre Habouzit ··O madcoder@debian.org OOO http://www.madism.org