public static List<CmdLineOptionInstance> loadValidateAndHandleInstances(
ApplicationContext appContext, String[] args) throws IOException {
// parse args
CmdLineOptionParser parser = new CmdLineOptionParser();
List<CmdLineOption> supportedOptions = CmdLineOptionUtils
.getOptions(appContext);
parser.setValidOptions(supportedOptions);
List<CmdLineOptionInstance> optionInstances = parser.parse(args);
// check that required args have been specified
List<CmdLineOption> reqOptions = CmdLineOptionUtils
.getRequiredOptions(supportedOptions);
List<CmdLineOption> unsetReqOptions = CmdLineOptionUtils