help-gengetopt
[Top][All Lists]
Advanced

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

[help-gengetopt] override and multiple options


From: Andre Noll
Subject: [help-gengetopt] override and multiple options
Date: Thu, 11 Dec 2008 13:28:31 +0100
User-agent: Mutt/1.5.9i

Hi

I just noticed a somewhat weird behaviour of gengetopt's config file
parser in combination with multiple options and the override feature.

If a (string) option is declared as multiple in the ggo file and was
given one or more times when calling the config file parser for the
first time, everything works as expected: the xxx_given field contains
the number of times this option was given, and xxx_option_arg[]
is a NULL-terminated array of that size containing the given values.

If the config file parser is later called again with a params struct
that enables override, I would expect it to _replace_ the array by
the values which have been found in the config file during this second
call. After all, this is what the word "override" indicates.

However, the new set of options are _appended_ to the old values
instead. Is this behaviour intended? If it is, is that feature
documented anywhere? If it isn't intended, what could be done to fix
the situation while retaining backwards compatibility?

Thanks
Andre
-- 
The only person who always got his work done by Friday was Robinson Crusoe

Attachment: signature.asc
Description: Digital signature


reply via email to

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