-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Sebastian Hoß <mail@shoss.de>
- Loading branch information
Showing
9 changed files
with
139 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
yosql-cli/src/main/java/de/xn__ho_hia/yosql/cli/CliEvents.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package de.xn__ho_hia.yosql.cli; | ||
|
||
import ch.qos.cal10n.BaseName; | ||
|
||
@BaseName("cli-events") | ||
enum CliEvents { | ||
|
||
PROBLEM_DURING_OPTION_PARSING; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
yosql-cli/src/main/java/de/xn__ho_hia/yosql/cli/OptionParsingException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package de.xn__ho_hia.yosql.cli; | ||
|
||
import joptsimple.OptionException; | ||
import joptsimple.OptionParser; | ||
|
||
class OptionParsingException extends RuntimeException { | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
private final OptionParser parser; | ||
|
||
private final OptionException exception; | ||
|
||
public OptionParsingException(final OptionParser parser, final OptionException exception) { | ||
super(exception); | ||
this.parser = parser; | ||
this.exception = exception; | ||
} | ||
|
||
public OptionParsingException(final OptionParser parser) { | ||
this(parser, null); | ||
} | ||
|
||
public OptionParser getParser() { | ||
return parser; | ||
} | ||
|
||
public boolean couldNotParseOptions() { | ||
return exception != null; | ||
} | ||
|
||
@Override | ||
public synchronized OptionException getCause() { | ||
return exception; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
PROBLEM_DURING_OPTION_PARSING=Error while parsing one of the specified options!\n\n\t{0}\n\nMaybe you meant {1}? If not, here are all possible values we currently allow:\n |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters