help-gengetopt
[Top][All Lists]
Advanced

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

Re: [help-gengetopt] Re: Gengetopt 2.21 enhancement suggestions


From: J. David Bryan
Subject: Re: [help-gengetopt] Re: Gengetopt 2.21 enhancement suggestions
Date: Wed, 17 Oct 2007 12:59:02 -0400

On 17 Oct 2007 at 12:41, Lorenzo Bettini wrote:

> Actually setting print_errors to 0 in the _init function causes
> previous code not to work anymore in some cases, and this is quite
> dangerous (e.g., some tests in the testsuite do not print error
> messages anymore); thus I set print_errors to 1 also in the _init
> function and changed the documentation accordingly.

I don't quite understand the intent of the "_init" function.  Wouldn't it 
make more sense if it initialized the values to the defaults (override = 0, 
initialize = 1, check_required = 1), rather than to all zeros?  Then:

  params = cmdline_parser_params_init();
  i = cmdline_parser_ext (..., params);

...would be the same as:

  i = cmdline_parser (...);

...and then in using "cmdline_parser_params_init", you would only have to 
change those items where the default behavior is not what is wanted.

But maybe I don't understand gengetopt enough yet to know why zeros are 
best.

                                      -- Dave





reply via email to

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