/usr/bin/getopt doesn't honor the -n option

Mike Dornberger Mike.Dornberger@gmx.de
Thu Apr 19 19:22:00 GMT 2012


`man 1 getopt' describes the -n/--name option as follows:

  | The  name  that  will  be used by the getopt(3) routines when it
  | reports errors. Note that errors of getopt(1) are still reported
  | as coming from getopt.

But the -n option isn't honored:

$ /usr/bin/getopt -n myprog -o abc -- -x
getopt: unknown option -- x

$ LANG=C LC_ALL=C /usr/bin/getopt --version
getopt from util-linux 2.21

I tested under Debian Squeeze (getopt from util-linux 2.17.2) to see
that I did understand the description right:

$ /usr/bin/getopt -n myprog -o abc -- -x
myprog: invalid option -- 'x'

 Mike Dornberger

PS: Please Cc: me on replies since I'm not subscribed to the list.

Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

More information about the Cygwin mailing list