use System.out if mode is JUST_SHOW_INFO (thus user can easily read license or help using … | less)
1.1 --- a/java/sql-dk/src/info/globalcode/sql/dk/CLIStarter.java Thu Dec 26 00:58:00 2013 +0100
1.2 +++ b/java/sql-dk/src/info/globalcode/sql/dk/CLIStarter.java Thu Dec 26 01:05:24 2013 +0100
1.3 @@ -27,6 +27,7 @@
1.4 import info.globalcode.sql.dk.formatting.FormatterContext;
1.5 import info.globalcode.sql.dk.formatting.FormatterException;
1.6 import java.io.IOException;
1.7 +import java.io.PrintStream;
1.8 import java.sql.SQLException;
1.9 import java.util.logging.Level;
1.10 import java.util.logging.LogRecord;
1.11 @@ -91,13 +92,15 @@
1.12 }
1.13
1.14 private void process() throws ConfigurationException, SQLException, FormatterException {
1.15 + MODE mode = options.getMode();
1.16 +
1.17 /** Show info */
1.18 if (!options.getShowInfo().isEmpty()) {
1.19 - InfoLister infoLister = new InfoLister(System.err, this);
1.20 + PrintStream infoOut = mode == MODE.JUST_SHOW_INFO ? System.out : System.err;
1.21 + InfoLister infoLister = new InfoLister(infoOut, this);
1.22 infoLister.showInfo(options);
1.23 }
1.24
1.25 - MODE mode = options.getMode();
1.26 switch (mode) {
1.27 case QUERY_NOW:
1.28 processQueryNow();