mirror of
https://codeberg.org/PGPainless/sop-java.git
synced 2024-12-22 12:57:57 +01:00
Add --stacktrace option
This commit is contained in:
parent
c32ef9830b
commit
fd4c22cde6
2 changed files with 10 additions and 1 deletions
|
@ -19,8 +19,13 @@ public class SOPExecutionExceptionHandler implements CommandLine.IExecutionExcep
|
|||
// CHECKSTYLE:OFF
|
||||
if (ex.getMessage() != null) {
|
||||
commandLine.getErr().println(colorScheme.errorText(ex.getMessage()));
|
||||
} else {
|
||||
commandLine.getErr().println(ex.getClass().getName());
|
||||
}
|
||||
|
||||
if (SopCLI.stacktrace) {
|
||||
ex.printStackTrace(commandLine.getErr());
|
||||
}
|
||||
ex.printStackTrace(commandLine.getErr());
|
||||
// CHECKSTYLE:ON
|
||||
|
||||
return exitCode;
|
||||
|
|
|
@ -52,6 +52,10 @@ public class SopCLI {
|
|||
|
||||
public static String EXECUTABLE_NAME = "sop";
|
||||
|
||||
@CommandLine.Option(names = {"--stacktrace"}, description = "Print Stacktrace",
|
||||
scope = CommandLine.ScopeType.INHERIT)
|
||||
static boolean stacktrace;
|
||||
|
||||
public static void main(String[] args) {
|
||||
int exitCode = execute(args);
|
||||
if (exitCode != 0) {
|
||||
|
|
Loading…
Reference in a new issue