fixes handlig of echo and verbose
@@ -37,9 +37,9 @@ import java.util.logging.Level;
import java.util.logging.Logger;
public class OConsoleApplication {
- protected static final String[] COMMENT_PREFIXS = new String[] { "#", "--", "//" };
public static final String ONLINE_HELP_URL = "https://raw.githubusercontent.com/orientechnologies/orientdb-docs/master/";
public static final String ONLINE_HELP_EXT = ".md";
+ protected static final String[] COMMENT_PREFIXS = new String[] { "#", "--", "//" };
protected final StringBuilder commandBuffer = new StringBuilder(2048);
protected InputStream in = System.in; // System.in;
protected PrintStream out = System.out;
@@ -53,10 +53,6 @@ public class OConsoleApplication {
protected String[] args;
protected TreeMap<Method, Object> methods;
- protected enum RESULT {
- OK, ERROR, EXIT
- }
-
public OConsoleApplication(String[] iArgs) {
this.args = iArgs;
}
@@ -247,7 +243,7 @@ public class OConsoleApplication {
}
if (commandLine != null) {
- if (iBatchMode || isEchoEnabled()) {
+ if ((iBatchMode && isEchoEnabled()) || isEchoEnabled()) {
out.println();
out.print(getPrompt());
out.print(commandLine);
@@ -266,9 +262,9 @@ public class OConsoleApplication {
}
}
- if (commandBuffer.length() == 0) {
+// if (commandBuffer.length() == 0) {
if (commandBuffer.length() > 0) {
- if (iBatchMode) {
+ if (iBatchMode && isEchoEnabled()) {
out.println();
out.print(getPrompt());
out.print(commandBuffer);
@@ -280,7 +276,7 @@ public class OConsoleApplication {
|| (status == RESULT.ERROR && !Boolean.parseBoolean(properties.get("ignoreErrors"))) && iBatchMode)
return false;
}
- }
+// }
} finally {
commandStream.close();
}
@@ -738,4 +734,8 @@ public class OConsoleApplication {
}
return result.toString();
}
+
+ protected enum RESULT {
+ OK, ERROR, EXIT
+ }
}
