getopt_long
Scott Bambrough
scottb@netwinder.org
Mon Dec 6 09:51:00 GMT 1999
The attached program experiments with getopt_long. It prints optarg for
each option, or (null) if optarg is NULL. If I attempt to use the -o
option I get the following results.
$ ./getopt_test -o
optional argument: (null)
$ ./getopt_test -o arg
optional argument: (null)
Non - option ARGV elements: arg
This happens for me with glibc 2.1.2 on x86 and ARM.
The -o option is supposed to take an optional argument. The
documentation leads me to believe that optarg will be set if an argument
for the option exists. Have I missed something or is this a bug?
Scott
--
Scott Bambrough - Software Engineer
REBEL.COM http://www.rebel.com
NetWinder http://www.netwinder.org
getopt_test.c
-------------- next part --------------
A non-text attachment was scrubbed...
Name: getopt_test.c
Type: text/x-c
Size: 1555 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-hacker/attachments/19991206/2dbb23cd/attachment.bin>
More information about the Libc-hacker
mailing list