Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
6717057
Failing test to catch and reproduce #143
pesse Jun 4, 2019
038981f
Merge branch 'develop' into feature/new_cli_library
pesse Jun 7, 2019
b21f651
Unit-Test to simulate passing all parameters that should be known
pesse Jun 7, 2019
ce849fc
Initial implementation of Picocli usage
pesse Jun 11, 2019
5520562
Some more tests around FileMapping
pesse Jun 12, 2019
f9c4cf7
New RunAction which does the logic based on RunCommandConfig
pesse Jun 12, 2019
d8cbce2
RunAction tested and functional so far
pesse Jun 12, 2019
3b5e168
Include RunAction into RunCommand
pesse Jun 12, 2019
60997d7
New entry point for Picocli
pesse Jun 12, 2019
d13ae5b
Extract functionality to interface
pesse Jun 12, 2019
5e86b01
Adapt tests to IRunCommand and implement necessary functionality
pesse Jun 12, 2019
00f3f5f
Change VersionCommand to Picocli
pesse Jun 12, 2019
2ce4e91
Change ReportersCommand to Picocli
pesse Jun 13, 2019
b88d5c5
Fix arity for mapping options and prevent NPE
pesse Jun 13, 2019
c80dc8c
Refactor RunCommandTest to cover new approach
pesse Jun 13, 2019
8eec2cb
Implement rules for printToScreen Reporters: Only one can go to screen
pesse Jun 13, 2019
ded39d3
Implemented new Picocli help
pesse Jun 13, 2019
6922e52
Removed some now unnecessary stuff
pesse Jun 13, 2019
5aa4c1d
We don't need the old RunCommand anymore, time to get rid of it
pesse Jun 13, 2019
60fcfaf
Improve help and help-tests
pesse Jun 13, 2019
a3608b5
Refactor: Remove unnecessary logic
pesse Jun 13, 2019
09bf357
Refactor: extract ReporterConfig -> ReporterOption conversion
pesse Jun 13, 2019
1b65b51
Refactor: getCommand() no longer needed
pesse Jun 13, 2019
77fd752
Refactor: Include only left check-functionality
pesse Jun 13, 2019
e443e3c
Refactor: Cleanup ReporterManager a bit
pesse Jun 13, 2019
0bdca7d
Get rid of JCommander dependency
pesse Jun 13, 2019
ae0e9c4
Move ConnectionString description to main Utplsql-Command
pesse Jun 18, 2019
f47c0de
Fix Typo
pesse Jun 18, 2019
bb18ea1
Some Refactorings and make things final
pesse Jun 18, 2019
1a984ff
Merge branch 'develop' into feature/new_cli_library
pesse Jun 18, 2019
81e0953
Reformatting
pesse Jun 18, 2019
a8acbb9
Add `-h` option to all commands and cover it with tests
pesse Jun 18, 2019
10bef7b
Adjust documentation to reflect parameter changes
pesse Jun 18, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Removed some now unnecessary stuff
  • Loading branch information
pesse committed Jun 13, 2019
commit 6922e5256d4b03d55bcbca09c3b64343017e50b2
38 changes: 0 additions & 38 deletions src/main/java/org/utplsql/cli/Cli.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package org.utplsql.cli;

import com.beust.jcommander.JCommander;
import com.beust.jcommander.ParameterException;
import picocli.CommandLine;

import java.util.List;
Expand All @@ -10,49 +8,13 @@ public class Cli {

static final int DEFAULT_ERROR_CODE = 1;

static final String HELP_CMD = "-h";

public static void main(String[] args) {

int exitCode = runPicocliWithExitCode(args);

System.exit(exitCode);
}

static int runWithExitCode( String[] args ) {

LoggerConfiguration.configure(LoggerConfiguration.ConfigLevel.NONE);
LocaleInitializer.initLocale();

JCommander jc = new JCommander();
jc.setProgramName("utplsql");

CommandProvider cmdProvider = new CommandProvider(jc);

cmdProvider.commands().forEach(cmd -> jc.addCommand(cmd.getCommand(), cmd));

int exitCode = DEFAULT_ERROR_CODE;

if ( args.length >= 1 && args[0].equals("-h") ) // Help?
{
exitCode = 0;
jc.usage();
}
else {
try {
jc.parse(args);

exitCode = cmdProvider.getCommand(jc.getParsedCommand()).run();

} catch (ParameterException e) {
exitCode = new HelpCommand(jc, e.getMessage()).run();
} catch (Exception e) {
e.printStackTrace();
}
}

return exitCode;
}
static int runPicocliWithExitCode( String[] args ) {

LoggerConfiguration.configure(LoggerConfiguration.ConfigLevel.NONE);
Expand Down
40 changes: 0 additions & 40 deletions src/main/java/org/utplsql/cli/CommandProvider.java

This file was deleted.

43 changes: 0 additions & 43 deletions src/main/java/org/utplsql/cli/HelpCommand.java

This file was deleted.

24 changes: 0 additions & 24 deletions src/main/java/org/utplsql/cli/TestRunnerTask.java

This file was deleted.