[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

argp OPTION_ARG_OPTIONAL and -short options

From: J. Jones
Subject: argp OPTION_ARG_OPTIONAL and -short options
Date: Tue, 2 Oct 2001 03:23:18 -0500
User-agent: Mutt/

I'm not sure if this is an actual bug or something that I'm doing wrong
with argp, but here goes.

The "short option" equivalents of options that accept an optional
argument don't seem to behave properly.  If the argument to --option is
required, then both -ofoo and -o foo return "foo" as the argument.  If
the argument is defined as optional, only -ofoo will return "foo" as the

Attached is the code that should display this behavior.  I've only
tested this with glibc 2.2.4.

<sample output from attached code>

$ ./argp-bug -g foo -b bar -h baz
Good:  foo
Bad:  (null)
Cheap Hack:  baz
$ ./argp-bug -g foo -bbar -h baz
Good:  foo
Bad:  bar
Cheap Hack:  baz

Is this something I'm doing wrong? The documentation leads me to believe
that I'm expecting the proper behavior, but not getting it.  ;)


Attachment: argp-bug.c
Description: Text document

reply via email to

[Prev in Thread] Current Thread [Next in Thread]