diff --git a/README.md b/README.md index 1b1a102..b5525cd 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,8 @@ database - database to connect to. If not defined, then output will be displayed on screen, even if the parameter -s is not specified. If more than one -o parameter is specified for one -f parameter, the last one is taken into consideration. -s - Forces putting output to to screen for a given -f parameter. +-c - If specified, enables printing of test results in colors as defined by ANSICONSOLE standards. + Works only on reporeters that support colors (ut_documentation_reporter). ``` Parameters -f, -o, -s are correlated. That is parameters -o and -s are controlling outputs for reporter specified by the preceding -f parameter. @@ -80,3 +82,7 @@ utplsql run hr/hr@xe ``` Invokes all unit test suites from schema "hr". Results are displayed to screen using default ut_documentation_reporter. + +##### Enabling Color Outputs on Windows + +To enable color outputs on Windows cmd you need to install an open-source utility called [ANSICON](http://adoxa.altervista.org/ansicon/). diff --git a/src/main/java/io/github/utplsql/cli/RunCommand.java b/src/main/java/io/github/utplsql/cli/RunCommand.java index 39e2299..fe80f2f 100644 --- a/src/main/java/io/github/utplsql/cli/RunCommand.java +++ b/src/main/java/io/github/utplsql/cli/RunCommand.java @@ -44,6 +44,11 @@ public class RunCommand { "-f reporter_name [output_file] [console_output]") private List reporterParams = new ArrayList<>(); + @Parameter( + names = {"-c", "--color"}, + description = "enables printing of test results in colors as defined by ANSICONSOLE standards") + private boolean colorConsole = false; + public ConnectionInfo getConnectionInfo() { return connectionInfoList.get(0); } @@ -81,11 +86,10 @@ public List getReporterOptionsList() { public void run() throws Exception { final ConnectionInfo ci = getConnectionInfo(); - System.out.println("Running Tests For: " + ci.toString()); final List reporterOptionsList = getReporterOptionsList(); - final List reporterList = new ArrayList<>(); final List testPaths = getTestPaths(); + final List reporterList = new ArrayList<>(); if (testPaths.isEmpty()) testPaths.add(ci.getUser()); @@ -109,6 +113,7 @@ public void run() throws Exception { new TestRunner() .addPathList(testPaths) .addReporterList(reporterList) + .colorConsole(colorConsole) .run(conn); } catch (SQLException e) { // TODO