diff --git a/src/main/java/com/rarchives/ripme/App.java b/src/main/java/com/rarchives/ripme/App.java index 3092f71b..73e0bb66 100644 --- a/src/main/java/com/rarchives/ripme/App.java +++ b/src/main/java/com/rarchives/ripme/App.java @@ -135,6 +135,13 @@ public class App { Utils.configureLogger(); logger.info("Initialized ripme v" + UpdateUtils.getThisJarVersion()); + //Set history file + if (cl.hasOption('H')) { + String historyLocation = cl.getOptionValue('H'); + Utils.setConfigString("history.location", historyLocation); + logger.info("Set history file to " + historyLocation); + } + //Allow file overwriting if (cl.hasOption('w')) { Utils.setConfigBoolean("file.overwrite", true); @@ -320,6 +327,7 @@ public class App { opts.addOption("p", "proxy-server", true, "Use HTTP Proxy server ([user:password]@host[:port])"); opts.addOption("j", "update", false, "Update ripme"); opts.addOption("a","append-to-folder", true, "Append a string to the output folder name"); + opts.addOption("H", "history", true, "Set history file location."); return opts; } diff --git a/src/main/java/com/rarchives/ripme/utils/Utils.java b/src/main/java/com/rarchives/ripme/utils/Utils.java index 32a5c70c..a15503d2 100644 --- a/src/main/java/com/rarchives/ripme/utils/Utils.java +++ b/src/main/java/com/rarchives/ripme/utils/Utils.java @@ -269,7 +269,11 @@ public class Utils { * Return the path of the url history file */ public static String getURLHistoryFile() { - return getConfigDir() + File.separator + "url_history.txt"; + if(getConfigString("history.location", "").length()==0) { + return getConfigDir() + File.separator + "url_history.txt"; + }else{ + return getConfigString("history.location", ""); + } } /** @@ -803,4 +807,4 @@ public class Utils { return new File(fullPath); } -} \ No newline at end of file +}