final String HISTORYFILE = ".hivehistory";
String historyFile = System.getProperty("user.home") + File.separator + HISTORYFILE;
reader.setHistory(new History(new File(historyFile)));
int ret = 0;
Log LOG = LogFactory.getLog("CliDriver");
LogHelper console = new LogHelper(LOG);
String prefix = "";
String curPrompt = prompt;
while ((line = reader.readLine(curPrompt+"> ")) != null) {
long start = System.currentTimeMillis();
if(line.trim().endsWith(";")) {
line = prefix + " " + line;
ret = processLine(line);
prefix = "";
curPrompt = prompt;
} else {
prefix = prefix + line;
curPrompt = prompt2;
continue;
}
long end = System.currentTimeMillis();
if (end > start) {
double timeTaken = (double)(end-start)/1000.0;
console.printInfo("Time taken: " + timeTaken + " seconds", null);
}
}
System.exit(ret);
}