mirror of
https://github.com/RipMeApp/ripme.git
synced 2025-08-26 07:14:38 +02:00
Merge pull request #1364 from inthebrilliantblue/master
Adding support for CLI option to change history file path.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user