Re: cmdline_file_save accepts file handler instead
"Papp Gyozo (VBuster)" <[email protected]>
| Newsgroups | gmane.comp.gnu.gengetopt.general |
|---|---|
| Message-ID | <[email protected]> |
Hi there,
> > because this way it would be easy to implement `--show-config'
> > feature which dumps the current settings e.g to stdout (like. gcc
> > -dump* options do)
>
> no problem, this'll be easy to implement :-)
Ok, thanks a lot. Please let me know if new (even beta/testing) package is available for download.
> by the way, I still haven't started to work on the group options we
Never mind because in the meanwhile we also postponed the integration of the two product where it could lend me some help. By the way, I still support it.
> discussed because I'm refactoring the generated code so that there's
> much less duplicated code,
Ooh then one another thing (I'm afraid I noted it earlier, too.)
What about merging the two help array into one? As far as I know, there are two separate array one with help string with each option while the other with only "public" options (no hidden). I prefer to do it like this:
struct {
const char *text;
int public;
} cmdline_options_help[] = {
{ " -h, --help Print help and exit", 1 },
...
};
void
cmdline_print_help (void)
{
...
for (i = 0; cmdline_options_help[i]; i++ ) {
if ( cmdline_options_help[i].public )
printf("%s\n", cmdline_options_help[i].text );
}
}
void
cmdline_print_help (void)
{
...
while (cmdline_options_full_help[i].text)
printf("%s\n", cmdline_options_full_help[i++].text);
}
It's just code cosmetic but it may leverage someone's convenience level with the gengetopt sources.