Environment variables
|
I think a separate config file might be a better solution since
you can't put everything in environment variables.
|
Why not? There had been a lot of discussion, after
the Changi config file had been last used in version 0.5.
Environment variables may create problems for people not used
to them in such an extend. But they have advantages:
- Changi consists of several programs, what makes it flexible.
Using a single config for all parts decreases it's flexibility.
Some environments (or workarounds) need different settings of
certain configuration items. Of course the old version was able
to optionally read different configuration files, but maintaining
two or even more copies of configuration files is a drag.
Environment variables may be set, where you need them.
- Environment variables are multilevel and may be easily overwritten
without the need to respecify the full set, if you want to change a
single item. You may set a few global items in config.sys
and define additional ones or overwrite exisiting definitions
in a batch file.
- Testing new setups is much easier. You enter a simple SET
on the command line and run the program. It's true, that you
may use command line options to overwrite config file items,
but setting environment variables becomes much easier, if
you need to deal with several items, because they remain in
effect even if the program must be startet a second time.
- Last not least, environment variables support modularization
of programs. Imagine some DLLs being shared by C executables
and REXX scripts or whatever. Should the DLL read the config
file again, already read by the caller? Should the caller
supply hundreds of configuration options before calling the
DLL entry? With environment variables any independend module
may pick itself those configuration items from the calling
process' environment it needs.
In summary one could say, that configuration files may be easier
to handle as long as things reamin simple. But if things
get complicated, environment variables offer some advantages.
|
|
Nice talk, but I'd still prefer a config file.
|
If you want a config file, you can get it with environment
variables too. Create a cmd file with all those variables
you want to set and use it instead of calling Changi and all
those other programs directly. You may add comments and make
it look like any ordinary config file. Or call Changi with
option -dC and rename changi.log to anything.cmd, which also
works with most of the other programs, Chanx, Expire, etc.
|