cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: ENV vars in config files?

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 2 Nov 2000 15:50:09 +0100 (MET)

On Thu, 2 Nov 2000, Kevin P Roth wrote:

> Just wondering if it would be easy to allow the use of ENVironment
> variables in config files.

Yes it would be fairly easy.

> I know curl is already reading these variables for proxy settings, so it
> seems like the code needed is probably already laying around.

The question I ask myself is if it would be sane to add more stuff to the
already crippled and stupid "config file" parser, or if it wouldn't be a
better investment to fix the config file completely instead.

How would a perfect "config file" work?

Without doing much thinking, I could imagine making a config file that works
like:

        [option] = [value]

Where [option] would be the same as the --long-option and [value] would
either be 'on/off/true/false' for booleans or a plain value for [option]s
that accept variable input (such as -d, -o, -H, -d, -F etc).

[value] could be written as plain text, and then the initial and trailing
white spaces would be stripped off, or it can be specified within quotes and
then all white spaces within the quotes will count.

[value] could then be made to accept some format to specify an environment
variable. I could even think of supporting

        [option] += [value]

for appending stuff to an option.

Whatever, I'm brainstorming here.

-- 
  Daniel Stenberg -- curl project maintainer -- http://curl.haxx.se/
Received on 2000-11-02