This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: getopt_long


On Mon, 6 Dec 1999, Scott Bambrough wrote:

> 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 

./getopt_test -oarg produces the result you want.  This behaviour is
documented in the man-page.  It boils down to the fact that libc can't
know if 'arg' is supposed to be associated with -o if it's in a separate
word.

Tim.
*/



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]