Boost logo

Boost :

From: Beman Dawes (bdawes_at_[hidden])
Date: 2003-01-15 19:57:57


At 10:43 AM 1/15/2003, Vladimir Prus wrote:

>I don't know how to compare number of people who need command line to the

>number of people who *also* need config file. I suppose that as your
>program grows bigger, you're likely to need config file too. The
transition
>should be simple.

I run into exactly that in production code.

At first, no one mentions the need for a config file.

Then, as more options are added over time, someone requests a config file.

I've got a little function that updates argc and argv to point to a new set
of values containing the original, less the config file indirection arg,
plus the args found in the config file (which are the same format as
regular command line arguments.) Works like a charm; very simple, and
everyone is happy. I usually echo the full set of args to cout as
documentation of the actual args seen by the program.

That's a long way of supporting Vladimir's views above. People first need
just command line arguments, then later realize a config file would be
nice. And yes, the transition should be simple and transparent.

--Beman


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk