mirror of
https://github.com/mitb-archive/filebot
synced 2025-03-09 05:51:31 -04:00
MAS does not support or allow command-line applications and may run executables with strange arguments for no apparent reason (e.g. filebot.launcher -psn_0_774333) so we ignore arguments completely in this case
This commit is contained in:
parent
7213220c86
commit
4b3ac80a88
@ -223,6 +223,9 @@
|
||||
<option value="-Dapple.laf.useScreenMenuBar=true" />
|
||||
<option value="-Dfile.encoding=UTF-8" />
|
||||
|
||||
<!-- MAS does not support or allow command-line applications and may run executables with strange arguments for no apparent reason (e.g. filebot.launcher -psn_0_774333) so we ignore arguments completely in this case -->
|
||||
<option value="-Dapple.app.launcher=true" />
|
||||
|
||||
<!-- libjfxwebkit.dylib cannot be deployed on the MAS due to deprecated dependencies -->
|
||||
<option value="-Dapplication.deployment=@{deployment}" />
|
||||
|
||||
|
@ -58,7 +58,7 @@ public class Main {
|
||||
public static void main(String[] argv) {
|
||||
try {
|
||||
// parse arguments
|
||||
ArgumentBean args = isMacSandbox() ? new ArgumentBean() : new ArgumentBean(argv); // MAS does not support or allow command-line applications and may run executables with strange arguments for no apparent reason (e.g. filebot.launcher -psn_0_774333)
|
||||
ArgumentBean args = ArgumentBean.parse(argv);
|
||||
|
||||
// just print help message or version string and then exit
|
||||
if (args.printHelp()) {
|
||||
|
@ -367,8 +367,8 @@ public class ArgumentBean {
|
||||
this.args = new String[0];
|
||||
}
|
||||
|
||||
public ArgumentBean(String... args) throws CmdLineException {
|
||||
this.args = args;
|
||||
public ArgumentBean(String[] args) throws CmdLineException {
|
||||
this.args = args.clone();
|
||||
|
||||
CmdLineParser parser = new CmdLineParser(this);
|
||||
parser.parseArgument(args);
|
||||
@ -393,4 +393,9 @@ public class ArgumentBean {
|
||||
return () -> new CmdlineException(message + ": " + value);
|
||||
}
|
||||
|
||||
public static ArgumentBean parse(String... args) throws CmdLineException {
|
||||
// MAS does not support or allow command-line applications and may run executables with strange arguments for no apparent reason (e.g. filebot.launcher -psn_0_774333) so we ignore arguments completely in this case
|
||||
return Boolean.parseBoolean(System.getProperty("apple.app.launcher")) || args == null ? new ArgumentBean() : new ArgumentBean(args);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user