Re: [dev] Config files

From: Nick <suckless-dev_AT_njw.me.uk>
Date: Wed, 9 Feb 2011 12:34:32 +0000

On Wed, Feb 09, 2011 at 11:29:31AM +0000, Connor Lane Smith wrote:
> On 9 February 2011 11:19, Nick <suckless-dev_AT_njw.me.uk> wrote:
> > So, what's a good, simple format to store config files?
> > Obviously XML is pretty gross. So, what do people here tend
> > to do?
>
> If your options are fairly simple (i.e., no nested structures etc),
> you could just make the config file valid shell:
>
> > key1=value1
> > key2=value2
>
> Trivial to parse in C, and you can pull the config into your script with:
>
> > . config

Aah yes, brilliant, thanks. I hadn't considered just using a
shell format, but it makes a lot of sense.

Nick
Received on Wed Feb 09 2011 - 13:34:32 CET

This archive was generated by hypermail 2.2.0 : Wed Feb 09 2011 - 13:36:03 CET