This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: getopt() argument permuting considered risky
- From: Simon Josefsson <jas at extundo dot com>
- To: "Michael T Kerrisk" <mtk-lists at gmx dot net>
- Cc: libc-alpha at sources dot redhat dot com, Geoff Clare <geoff at gclare dot org dot uk>
- Date: Wed, 04 Aug 2004 22:06:27 +0200
- Subject: Re: getopt() argument permuting considered risky
- References: <30806.1091610569@www49.gmx.net>
Thought I could mention a story about the getopt argument permutation:
For my fork of GNU InetUtils I received a patch that would add "+" to
disable the permutation, because this command:
rsh sol tail -f /var/log/mail
Would get permuted into:
rsh -f sol tail /var/log/mail
And the getopt command line parser would try to interpret the '-f',
which would fail.
On the ranting side, I think it would have been better if this feature
had originally been introduced via a separate API, say getopt_gnu,
instead. That would have minimized surprises, both pleasant and
unpleasant ones.