[elinks-dev] Re: [ELinks] elinks - jonas: Add --config-dump which dump a configurat...

Jonas Fonseca fonseca at diku.dk
Sat May 7 03:53:56 PDT 2005


Miciah Dashiel Butler Masters <miciah at myrealbox.com> wrote Sat, May 07, 2005:
> On Thu, Apr 21, 2005 at 11:50:20AM -0000, cvs at pasky.or.cz wrote:
> > [...]
> > Add --config-dump which dump a configuration file with default options to stdout. Helpfull for packagemaintainers when providing an example config file and it costs nearly nothing.
> > [...]
> > --- elinks/src/config/cmdline.c:1.118	Fri Apr 15 03:00:18 2005
> > +++ elinks/src/config/cmdline.c	Thu Apr 21 13:50:15 2005
> > @@ -594,6 +594,24 @@
> >  	return NULL;
> >  }
> >  
> > +static unsigned char *
> > +printconfigdump_cmd(struct option *option, unsigned char ***argv, int *argc)
> > +{
> > +	unsigned char *config_string;
> > +
> > +	/* Print all. */
> > +	get_opt_int("config.saving_style") = 2;
> > +
> > +	config_string = create_config_string("", "", config_options);
> > +	if (config_string) {
> > +		printf("%s", config_string);
> > +		mem_free(config_string);
> > +	}
> > +
> > +	fflush(stdout);
> > +	return "";
> > +}
> > +
> 
> I bet that it prints the wrong value for config.saving_style.

One out of a million is not that bad. ;) But good point! Should I
introduce a global that can be checked when the config/conf.c code
would otherwise fetch the value of config.saving_style?

> In fact,
> I wouldn't be surprised if it messes up when I stick some -eval
> 'set foo = bar' before the -config-dump.

Why? It could be used for making a default config where some options
differ from the built-in.

-- 
Jonas Fonseca



More information about the elinks-dev mailing list