diff --git a/source/net/sourceforge/filebot/Main.java b/source/net/sourceforge/filebot/Main.java index 26ecb66d..de5c3b93 100644 --- a/source/net/sourceforge/filebot/Main.java +++ b/source/net/sourceforge/filebot/Main.java @@ -84,17 +84,22 @@ public class Main { System.exit(0); } + // make sure java.io.tmpdir exists + File tmpdir = new File(System.getProperty("java.io.tmpdir")); + tmpdir.mkdirs(); + // initialize this stuff before anything else initializeCache(); initializeSecurityManager(); - // make sure tmpdir exists - File tmpdir = new File(System.getProperty("java.io.tmpdir")); - tmpdir.mkdirs(); - if (args.clearUserData()) { + System.out.println("Reset preferences"); + Settings.forPackage(Main.class).clear(); + } + + if (args.clearCache()) { // clear preferences and cache - System.out.println("Reset preferences and clear cache"); + System.out.println("Clear cache and temporary files"); for (File cache : getApplicationFolder().listFiles(FOLDERS)) { if (matches("cache|temp|grape", cache.getName())) { for (File it : cache.listFiles()) { @@ -102,11 +107,7 @@ public class Main { } } } - Settings.forPackage(Main.class).clear(); CacheManager.getInstance().clearAll(); - - // just clear all data and then exit - System.exit(0); } // set unixfs system property diff --git a/source/net/sourceforge/filebot/cli/ArgumentBean.java b/source/net/sourceforge/filebot/cli/ArgumentBean.java index 63f5d2de..7b754d7d 100644 --- a/source/net/sourceforge/filebot/cli/ArgumentBean.java +++ b/source/net/sourceforge/filebot/cli/ArgumentBean.java @@ -90,8 +90,11 @@ public class ArgumentBean { @Option(name = "-open", usage = "Open file in GUI", metaVar = "file") public boolean open = false; - @Option(name = "-clear", usage = "Clear cache and application settings") - public boolean clear = false; + @Option(name = "-clear-cache", usage = "Clear cached and temporary data") + public boolean clearCache = false; + + @Option(name = "-clear-prefs", usage = "Clear application settings") + public boolean clearPrefs = false; @Option(name = "-unixfs", usage = "Do not strip invalid characters from file paths") public boolean unixfs = false; @@ -113,7 +116,7 @@ public class ArgumentBean { public boolean runCLI() { - return rename || getSubtitles || getMissingSubtitles || check || list || mediaInfo || extract || clear || script != null; + return rename || getSubtitles || getMissingSubtitles || check || list || mediaInfo || extract || script != null; } @@ -132,8 +135,13 @@ public class ArgumentBean { } + public boolean clearCache() { + return clearCache; + } + + public boolean clearUserData() { - return clear; + return clearPrefs; } diff --git a/website/cli.html b/website/cli.html index 02b7f7f9..7e2346cb 100644 --- a/website/cli.html +++ b/website/cli.html @@ -335,7 +335,6 @@