use of com.orientechnologies.common.console.TTYConsoleReader in project orientdb by orientechnologies.
the class OConsoleDatabaseApp method main.
public static void main(final String[] args) {
int result = 0;
try {
boolean tty = false;
try {
if (setTerminalToCBreak())
tty = true;
Runtime.getRuntime().addShutdownHook(new Thread() {
@Override
public void run() {
restoreTerminal();
}
});
} catch (Exception ignored) {
}
new OSignalHandler().installDefaultSignals(new SignalHandler() {
public void handle(Signal signal) {
restoreTerminal();
}
});
final OConsoleDatabaseApp console = new OConsoleDatabaseApp(args);
if (tty)
console.setReader(new TTYConsoleReader());
result = console.run();
} finally {
restoreTerminal();
}
Orient.instance().shutdown();
System.exit(result);
}
use of com.orientechnologies.common.console.TTYConsoleReader in project orientdb by orientechnologies.
the class OGremlinConsole method main.
public static void main(final String[] args) {
int result;
try {
boolean tty = false;
try {
if (setTerminalToCBreak())
tty = true;
} catch (Exception e) {
}
final OConsoleDatabaseApp console = new OGremlinConsole(args);
if (tty)
console.setReader(new TTYConsoleReader());
result = console.run();
} finally {
try {
stty("echo");
} catch (Exception e) {
}
}
System.exit(result);
}
Aggregations