How would you identify and fix the following code smell:
I've got a small scientific computing app that I'm writing that has to be able to handle lots of variations on the same theme. The inner workings of it are well-factored, mostly using the template method pattern and some higher-order functions. However, specifying how all these classes and functions should be instantiated and used and with what parameters in any given run of the program is so complicated that I sometimes think the easiest way to do it would be to rewrite main() for every run and recompile it.
Is there a relatively simple, lightweight way of doing configuration management that's not overkill for a small scientific app? Basically I've been just using command line switches and they're getting pretty unwieldy.
Edit: The app is small enough that build times are negligible. I see little advantage in binding to a scripting language over simply modifying the code in the native language. (The app is written in the D programming language.)
Edit # 2: I thought of the config file idea and it would help, but I feel like writing the config file would be almost as hard as rewriting main() every time.