This changes we way we mix getopt with configuration from file.
The previous way was to read getopt flags into members of an instantiated struct, then read the configuration file into members of another struct of the same type, and then meld the two. This caused problems where melding failed due when an overriding getopt false flag failed to overwrite a configuration file true (due to false being indistinguishable from bool.init).
This approach does it serially; reads the configuration file and applies the settings therein to instances of the relevant structs, and then passes the (addresses of) the same member variables to getopt. It's simpler, and we can get rid of the meldSettingsFromFile dance and the adjustGetopt hacks entirely.
This changes we way we mix getopt with configuration from file.
The previous way was to read getopt flags into members of an instantiated struct, then read the configuration file into members of another struct of the same type, and then meld the two. This caused problems where melding failed due when an overriding getopt false flag failed to overwrite a configuration file true (due to
false
being indistinguishable frombool.init
).This approach does it serially; reads the configuration file and applies the settings therein to instances of the relevant structs, and then passes the (addresses of) the same member variables to getopt. It's simpler, and we can get rid of the
meldSettingsFromFile
dance and theadjustGetopt
hacks entirely.So far it seems to work.