}
}
start = System.nanoTime();
if(!useOldCommandLineStyle){
CommandLine cl = new CommandLine(args);
System.out.println("command line after arg file expansion:");
System.out.println(cl);
cl.removeProcessed();
System.out.println("Command line after clean up:");
System.out.println(cl);
cl.addArgDefs(t.getArgDefs());
boolean argsRemain;
try{
do {
argsRemain = cl.processArg(true);
} while (argsRemain);
//Configuration check after first pass through command line
if (false == cl.isAllArgsRecognized()) {
throw new InvalidCommandLineException("Not all arguments were recognized:\n" + cl.toString());
}
} catch (InvalidCommandLineException ex){
throw new InvalidCommandLineException("Argument "+cl.getCurArgIndex()+" is not valid\n"+
"Command line dump:\n"+cl.toString(),ex);
}catch (Throwable ex){
throw new RuntimeException("Error happened during evaluation of argument "+cl.getCurArgIndex()+
"\nCommand line dump:\n"+cl.toString(),ex);
}
cl.setCurArgIndex(-1);
int execOut = t.execute(terminal);
do{
argsRemain=cl.processArg(false);
}while(argsRemain);
if(cl.isAllArgsProcessed()){
terminal.logLine(ScardLogHandler.LOG_INFO,"INFO: All command line arguments processed.");
}else{
throw new InvalidCommandLineException("Not all command line arguments have been processed.\n"+cl.toString());
}
}else{
oldStyleCommandLine.processArgs();
int execOut = t.execute(terminal);
}