help-gengetopt
[Top][All Lists]
Advanced

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

[help-gengetopt] BUG : mutiple and argoptional option fail to fill <opt>


From: Frédéric Heitzmann
Subject: [help-gengetopt] BUG : mutiple and argoptional option fail to fill <opt>_args[0] with default value
Date: Fri, 19 Oct 2012 10:57:40 +0200

Hi all,

I defined and option like this :

option "foo" - "bla bla bla" string typestr="STR" default="default_foo" argoptional multiple optional

If I call with --foo, the default value is not added to foo_args[0].
Actually, foo_args[0] is a NULL pointer, while I expected that foo_args[0] would be string "default_foo".

If I remove 'default', and set --foo without any argument, this time foo_args[0] is set to "default_foo".

The documentation says :
"If it is known that a multiple option has a default value, then it can be safely assumed that the first element of generated array <option>_arg is always set. "

so it really looks like a bug to me.

Can someone confirm ?
I may work on a patch if it helps.

--
Fred





reply via email to

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