Author: taher
Date: Thu May 19 07:54:16 2016
New Revision: 1744525
URL:
http://svn.apache.org/viewvc?rev=1744525&view=revLog:
provide pretty printing for error messages for startup OFBIZ-6783
Box the error messages with "=======" strings to highlight
the error the to user when calling java -jar ofbiz.jar --somewrongcommand
Modified:
ofbiz/trunk/framework/start/src/org/ofbiz/base/start/Start.java
ofbiz/trunk/framework/start/src/org/ofbiz/base/start/StartupCommandUtil.java
Modified: ofbiz/trunk/framework/start/src/org/ofbiz/base/start/Start.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/start/src/org/ofbiz/base/start/Start.java?rev=1744525&r1=1744524&r2=1744525&view=diff==============================================================================
--- ofbiz/trunk/framework/start/src/org/ofbiz/base/start/Start.java (original)
+++ ofbiz/trunk/framework/start/src/org/ofbiz/base/start/Start.java Thu May 19 07:54:16 2016
@@ -76,7 +76,7 @@ public final class Start {
ofbizCommands = StartupCommandUtil.parseOfbizCommands(args);
} catch (StartupException e) {
// incorrect arguments passed to the command line
- System.err.println("Error: " + e.getMessage() + System.lineSeparator());
+ StartupCommandUtil.printAndHighlightMessage(e.getMessage());
StartupCommandUtil.printOfbizStartupHelp(System.err);
System.exit(1);
}
Modified: ofbiz/trunk/framework/start/src/org/ofbiz/base/start/StartupCommandUtil.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/start/src/org/ofbiz/base/start/StartupCommandUtil.java?rev=1744525&r1=1744524&r2=1744525&view=diff==============================================================================
--- ofbiz/trunk/framework/start/src/org/ofbiz/base/start/StartupCommandUtil.java (original)
+++ ofbiz/trunk/framework/start/src/org/ofbiz/base/start/StartupCommandUtil.java Thu May 19 07:54:16 2016
@@ -176,6 +176,16 @@ public final class StartupCommandUtil {
true);
}
+ static final void printAndHighlightMessage(String message) {
+ System.err.println(
+ "==============================================================================="
+ + System.lineSeparator()
+ + message
+ + System.lineSeparator()
+ + "==============================================================================="
+ );
+ }
+
private static final List<StartupCommand> mapCommonsCliOptionsToStartupCommands(final CommandLine commandLine) {
List<Option> optionList = Arrays.asList(commandLine.getOptions());
return optionList.stream()