[quote user="VGR"]
Okay, I get that someone couldn't resist the desire to use 'switch', but seriously, there is nothing at all wrong with this:
if (arg[0].equals("-help")) { showHelp(); } else if (args[0].equals("-single")) { processSingle(); } else if (args[0].equals("-multi")) { processMultiple(); }
[/quote]
I like to do it like this:
if ("-single".equals (args[0])) {
This way a NullPointerException will not occur.