The script automates [url-http://vegastrike.sourceforge.net/forum ... 4249#94249]the procedure originally suggested by safemode[/url] to find config variables and their defaults; it scans the sources for instances of accesses to vegastrike.config, strips out everything other than the "var name=..." part, generates alphabetically sorted internal tables per section, and outputs the results to a valid xml file. Here's a randomly picked excerpt from the generated file:
Code: Select all
<section name="splash" >
<var name="auto_hide" value="true" /> <!-- main.cpp:722 -->
<var name="while_loading_starsystem" value="false" /> <!-- universe_generic.cpp:278 -->
</section>
Code: Select all
<section name="unitaudio" >
<var name="afterburner" value="sfx10.wav" /> <!-- cmd/unit_csv.cpp:562 cmd/unit_xml.cpp:1225 -->
<var name="armor" value="sfx08.wav" /> <!-- cmd/unit_csv.cpp:570,574 cmd/unit_xml.cpp:1233,1237 -->
<var name="cloak" value="sfx43.wav" /> <!-- cmd/unit_csv.cpp:558 cmd/unit_xml.cpp:1221 -->
<var name="explode" value="explosion.wav" /> <!-- cmd/unit_csv.cpp:578 cmd/unit_xml.cpp:1241 -->
<!-- <var name="explode" value="sfx43.wav" /> --><!-- cmd/unit_csv.cpp:582 cmd/unit_xml.cpp:1245 ['duplicate variable'] -->
...............
Code: Select all
<!-- <section name=category > -->
<!-- <var name=option value=def /> --> <!-- universe_util_generic.cpp:155 ['section not quoted', 'variable not quoted', 'value not quoted', 'broken section'] -->
<!-- </section> -->
<!-- <section name=section > -->
<!-- <var name=name value=def /> --> <!-- universe_util_generic.cpp:720 ['section not quoted', 'variable not quoted', 'value not quoted', 'broken section'] -->
<!-- <section name=subsection > -->
<!-- <var name=name value=def /> --> <!-- universe_util_generic.cpp:723 ['section not quoted', 'subsection not quoted', 'variable not quoted', 'value not quoted', 'broken section', 'broken subsection', 'duplicate variable'] -->
<!-- </section> -->
<!-- </section> -->
<!-- <section name=std::string('player')+((squadnum>0)?XMLSupport::tostring(squadnum+1):std::string('')) > -->
<!-- <var name="callsign" value="pilot" /> --> <!-- options.cpp:130 ['section not quoted', 'broken section'] -->
<!-- </section> -->
</variables>
</vegaconfig>
https://svn.wcjunction.com/priv_pu/trun ... _config.py
Its latest generated xml output, as of this writing, can be seen here:
https://svn.wcjunction.com/priv_pu/trun ... config.xml
For usage, check Wolphin's find_vs_config.py announcement at the PU board.
I believe this should help with safemode's project of cleaning up the config variables, first of all. Secondly, it is a major leap in documenting vegastrike.config. My suggestion would be that the script be installed on the sourceforge server, as a post-commit hook, to generate an updated output each time there's a commit to svn trunk, and automatically post it to a wiki page.
Once that's done, the work of documenting the variables (explaining what they are for) should be a breeze, and could cross-reference to the generated file.
Perhaps a modification of the script to make it generate wiki formatted headings for each section would be in order, so that cross references can link to the relevant section within the page.
Cheers!