Add BOM file extension to BOM plugin command line
Fixes #6943 (closed)
This adds the BOM's file extension to the command line for the BOM plugin, so you don't get extensionless BOMs by default.
There's not a great way to do this without requiring each BOM plugin to define the output file's extension in a standardized way. What I implemented was the best way I could come up with, but it is a bit fragile. I am assuming that BOM plugins are reasonably well formed. If that's not an acceptable assumption, then I don't have any other ideas :)
This attempts to determine the BOM file extension from the command line given in each BOM plugin's header, which is already read from the plugin file to display in the GUI as the description for each plugin. It searches the header for "%O and then grabs the extension (everything leading up to the closing "). If there is no extension, or if it can't find "%O in the header (several plugins have a blank header), then you still get an extensionless BOM.
Note that BOM plugin command lines are saved in the eeschema.json preferences file, and are not updated once they're stored in the preferences file, so in order to test this you'll have to wipe your eeschema preferences.
The linked bug is milestoned 5.1, but I did this MR against master. It could be cherrypicked pretty easily if there's any desire to do that at this stage of the game.
Also, C++ is not my strong suit, so I'm sorry in advance if I'm doing anything dumb here.