mirror of
https://github.com/mitb-archive/filebot
synced 2024-08-13 17:03:45 -04:00
Refactor and extend new ExitCode logic
This commit is contained in:
parent
111e4661d9
commit
f8e3c3460d
@ -1,4 +1,4 @@
|
||||
package net.filebot.cli;
|
||||
package net.filebot;
|
||||
|
||||
public class ExitCode {
|
||||
|
||||
@ -12,6 +12,6 @@ public class ExitCode {
|
||||
|
||||
public static final int DIE = 4;
|
||||
|
||||
public static final int NO_OPERATION = 10;
|
||||
public static final int NOOP = 100;
|
||||
|
||||
}
|
@ -3,10 +3,10 @@ package net.filebot;
|
||||
import static java.awt.GraphicsEnvironment.*;
|
||||
import static java.util.Arrays.*;
|
||||
import static java.util.stream.Collectors.*;
|
||||
import static net.filebot.ExitCode.*;
|
||||
import static net.filebot.Logging.*;
|
||||
import static net.filebot.MediaTypes.*;
|
||||
import static net.filebot.Settings.*;
|
||||
import static net.filebot.cli.ExitCode.*;
|
||||
import static net.filebot.ui.GettingStartedUtil.*;
|
||||
import static net.filebot.util.FileUtilities.*;
|
||||
import static net.filebot.util.FileUtilities.getChildren;
|
||||
|
@ -1,10 +1,10 @@
|
||||
package net.filebot.cli;
|
||||
|
||||
import static java.nio.charset.StandardCharsets.*;
|
||||
import static net.filebot.ExitCode.*;
|
||||
import static net.filebot.Logging.*;
|
||||
import static net.filebot.MediaTypes.*;
|
||||
import static net.filebot.Settings.*;
|
||||
import static net.filebot.cli.ExitCode.*;
|
||||
import static net.filebot.util.ExceptionUtilities.*;
|
||||
import static net.filebot.util.FileUtilities.*;
|
||||
|
||||
@ -75,6 +75,7 @@ public class ArgumentProcessor {
|
||||
return d.getExitCode();
|
||||
}
|
||||
|
||||
log.log(Level.SEVERE, e, e::getMessage);
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
|
@ -40,6 +40,7 @@ import groovy.lang.Closure;
|
||||
import groovy.lang.MissingPropertyException;
|
||||
import groovy.lang.Script;
|
||||
import groovy.xml.MarkupBuilder;
|
||||
import net.filebot.ExitCode;
|
||||
import net.filebot.HistorySpooler;
|
||||
import net.filebot.RenameAction;
|
||||
import net.filebot.StandardRenameAction;
|
||||
@ -171,11 +172,11 @@ public abstract class ScriptShellBaseClass extends Script {
|
||||
}
|
||||
|
||||
public void die(Object cause) throws Throwable {
|
||||
die(ExitCode.DIE, cause);
|
||||
die(cause, ExitCode.DIE);
|
||||
}
|
||||
|
||||
public void die(int exitCode, Object... cause) throws Throwable {
|
||||
throw new ScriptDeath(exitCode, getMessage(cause));
|
||||
public void die(Object cause, int exitCode) throws Throwable {
|
||||
throw new ScriptDeath(exitCode, String.valueOf(cause));
|
||||
}
|
||||
|
||||
// define global variable: _args
|
||||
|
Loading…
Reference in New Issue
Block a user