Hi Roman,
since you stated you were going to think a bit more about additional support for MESS software lists, let me move here the 'discussion' so that the MESS 0.141 thread at mameworld can rest in peace

Feel free to ignore this post until you are ready for look into the issue, I just wanted to collect here the info you might eventually need

First, the current batchrun option is very valuable and of course should be kept as is, given that it is the only way to scan/rebuild the software lists that have not yet been fully connected to MESS. We have indeed a few lists in the hash/ directory that cannot still be used to load software in MESS but that are important to document known dumps (e.g. c64_cart, a7800, a800, etc.)!
However, for the lists that have been fully hooked up to the emulator, it would be nice to have a slightly more complete support. Let me sum up a bit the ways in which you can currently retrieve xml lists from MESS.exe, so that you can get a better picture:
1. software lists appear in the -lx output: if a system has a list 'connected', its entry will look something like the gbcolor one:
<machine name="gbcolor" sourcefile="gb.c" cloneof="gameboy" romof="gameboy">
<description>Game Boy Color</description>
<year>1998</year>
<manufacturer>Nintendo</manufacturer>
<rom ...>
<chip ...>
<softwarelist name="gbcolor" status="original" />
<softwarelist name="gameboy" status="compatible" />
</machine>
Notice that
- there are 'original' lists and 'compatible' lists (the latter are always 'original' for some other systems, gameboy in the example above), to allow MESS to support backward compatibility of some systems; you can safely skip the "compatible" ones for basic support
- clones of a system will often have the same software lists as the parent (but not always, like the gbcolor example shows

), therefore lists are repeated many times inside the xml output
- some systems have multiple 'original' lists (e.g. fm7 has both fm7_cass for tapes and fm7_flop for disks)
- some systems have no lists
As a result, you can use -lx to obtain a full list of the 'connected' software lists (e.g. by listing each <softwarelist> entry and removing duplicates)
2. you can obtain a single xml file with all the software lists by using the "mess -listsoftware" command (I have also added a short version -lsoft this morning, so there will be also the short version in next version). This produces a (large) xml file containing all the lists
<softwarelists>
<softwarelist name="a5200" description="Atari 5200 cartridges">
<software name="xxx">
...etc...
</software>
...etc...
</softwarelist>
...etc...
<softwarelist name="rx78" description="Gundam RX-78 cartridges">
<software name="basic">
...etc...
</software>
</softwarelist>
</softwarelists>
and here each list appears only once.
3. you can use -listsoftware with any particular system to retrieve its own list (say "mess nes -listsoftware" to obtain the nes.xml content), if there is one; but I think this might only be suitable for you if you ever get to advanced option support...
With all this in mind, a first possibility (but it is just a proof of concept, and it might possibly not fit clrmame, I dunno) could be
a. you run -lx and create a list of the available software lists (removing duplicates)
b. you prompt the user with a check list with the available software lists, so that he can select the ones he wants
c. you run -listsoftware generating the full set of lists in a file, and only parse the file to extract the selected lists
or, simplifying it further, you can only let the user to scan/rebuild all lists at once (skipping point b. and only parsing the whole -listsoftware output)
notice that the officially supported folder structure is only
- rompath/
- rompath/listname1/
- rompath/listname2/
- rompath/listname3/
- ....
where listnameX is the name of each list (in the example above gameboy.xml -> rompath/gameboy/, gbcolor.xml -> rompath/gbcolor etc.), so that you can even only ask the user for the rompath he wants and then rebuild/scan like with the current batchrun
That's all, let me know if there is any point which is not clear, and thanks for the attention