I'm in my second year at uni, doing a Computer Science degree, and am now starting to write non-trivial programs. I'm learning lots of intermediate level stuff, but one thing I'm stumped on is handling many concurrent user options.
I'm writing a program at the moment that takes multiple (say 20) user options, and uses them in combination to process the input. I've read the options using getopt_long into structures of related options, and validated them. Now I need to figure out the best way to use the options.
A massive function full of nested if statements doesn't sound good to me. Nor does having a different function for each combination of options :P Is a combination of both of those approaches sensible? Is there a good way to do this, or will I just cop it because I've got so many program options?
I want to avoid messy code, but I also need this to be quick to run, as it will be used a lot, so I can't afford to go through 20 if statements on each iteration.
Thanks for the help Any input at all is appreciated.