Hi Harlan, et al.,
I have a need for doing controlled edits of complicated config files.
AutoOpts reads and processes them, but it did not write everything back out.
The hierarchical values (e.g. XML-ish values) were a bother I didn't do it.
Now I have. There is still work that needs doing, but the first prototype
is mostly there. Feedback and suggestions gladly accepted. Here is
a crude example, extracted from a test case:
$ ./nested -s 'stumble, foo, <bar type=integer>1234</bar>, able' \
-s 'foo, <bar type=integer>4321</bar> <gr type=nested>one, two=2,
three</gr>' \
'->'
$ cat nested.d/nested.cfg
# test_nested - Test AutoOpts for nested
# preset/initialization file
# ***DATE***
#
<struct>
<able/>
<bar type="integer">0x4D2</bar>
<foo/>
<stumble/>
</struct>
<struct>
<bar type="integer">0x10E1</bar>
<foo/>
<gr>
<one/>
<three/>
<two>2</two>
</gr>
</struct>
The remaining task is to devise a way for specifying which entries to remove.
http://autogen.sourceforge.net/autogen-5.9.6pre2.tar.gz
Cheers - Bruce
P.S. the intent here is for an auxiliary program to do the editing for a
daemon's
configuration file. The editing program would look something like this:
int
main(int argc, char ** argv)
{
int ct = optionProcess(&daemonOptions, argc, argv);
optionSaveFile(&daemonOptions);
kill(atoi(argv[ct]), SIGHUP);
return 0;
}
The option/config state is only saved if optionProcess is happy and returns.
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Autogen-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/autogen-users