File scriptFile=arg.getSingleFile(ARG_SET_BEFORE_DISCONNECT_SCRIPT);
if(null==scriptFile)
terminal.setBeforeDisconnectScript(null);
else{
try {
StarScriptReader reader = new StarScriptReader(scriptFile);
terminal.setBeforeDisconnectScript(reader.getCmds());
} catch (Throwable ex) {
throw new InvalidCommandLineException(ex);
}
}
}else if(arg.value.startsWith(ARG_SET_BEFORE_CONNECT_SCRIPT)){
File scriptFile=arg.getSingleFile(ARG_SET_BEFORE_CONNECT_SCRIPT);
if(null==scriptFile)
terminal.setBeforeConnectScript(null);
else{
try {
StarScriptReader reader = new StarScriptReader(scriptFile);
terminal.setBeforeConnectScript(reader.getCmds());
} catch (Throwable ex) {
throw new InvalidCommandLineException(ex);
}
}
}else if(arg.value.startsWith(ARG_SET_AFTER_CONNECT_SCRIPT)){
File scriptFile=arg.getSingleFile(ARG_SET_AFTER_CONNECT_SCRIPT);
if(null==scriptFile){
terminal.setAfterConnectScript(null);
System.out.println("Set After connect script to null");
} else {
try {
System.out.println("Set After connect script to " + scriptFile.getCanonicalPath());
} catch (IOException ex) {
Logger.getLogger(TerminalArgHandler.class.getName()).log(Level.SEVERE, null, ex);
}
try {
StarScriptReader reader = new StarScriptReader(scriptFile);
System.out.println("After connect script has " + reader.getCmds().size() + " objects");
terminal.setAfterConnectScript(reader.getCmds());
} catch (Throwable ex) {
throw new InvalidCommandLineException(ex);
}
}
}else if(arg.value.startsWith(ARG_SET_UNEXPECTED_CARD_RESPONSE_SCRIPT)){
File scriptFile=arg.getSingleFile(ARG_SET_UNEXPECTED_CARD_RESPONSE_SCRIPT);
if(null==scriptFile)
terminal.setUnexpectedCardResponseScript(null);
else{
try {
StarScriptReader reader = new StarScriptReader(scriptFile);
terminal.setUnexpectedCardResponseScript(reader.getCmds());
} catch (Throwable ex) {
throw new InvalidCommandLineException(ex);
}
}
/*}else if(arg.value.startsWith(ARG_SET_UNEXPECTED_CARD_RESPONSE_RESUME_SCRIPT)){
File scriptFile=arg.getSingleFile(ARG_SET_UNEXPECTED_CARD_RESPONSE_RESUME_SCRIPT);
if(null==scriptFile)
terminal.setUnexpectedCardResponseResumingScript(null);
else{
try {
StarScriptReader reader = new StarScriptReader(scriptFile);
terminal.setUnexpectedCardResponseResumingScript(reader.getCmds());
} catch (Throwable ex) {
throw new InvalidCommandLineException(ex);
}
}*/
}else if(arg.value.startsWith(ARG_SET_APDU_TIMEOUT_SCRIPT)){
File scriptFile=arg.getSingleFile(ARG_SET_APDU_TIMEOUT_SCRIPT);
if(null==scriptFile)
terminal.setApduTimeoutScript(null);
else{
try {
StarScriptReader reader = new StarScriptReader(scriptFile);
terminal.setApduTimeoutScript(reader.getCmds());
} catch (Throwable ex) {
throw new InvalidCommandLineException(ex);
}
}
}else if(arg.value.startsWith(ARG_SET_APDU_MISC_ERROR_SCRIPT)){
File scriptFile=arg.getSingleFile(ARG_SET_APDU_MISC_ERROR_SCRIPT);
if(null==scriptFile)
terminal.setApduMiscErrorScript(null);
else{
try {
StarScriptReader reader = new StarScriptReader(scriptFile);
terminal.setApduMiscErrorScript(reader.getCmds());
} catch (Throwable ex) {
throw new InvalidCommandLineException(ex);
}
}
}else if(arg.value.startsWith(ARG_SET_TERM_ENV)){