Merge pull request #149 from Dimtree/master

Added -d and -D flags, formatting
This commit is contained in:
4_pr0n 2015-01-10 15:30:49 -08:00
commit d957bdb25a

View File

@ -60,9 +60,9 @@ public class App {
if (cl.hasOption('t')) { if (cl.hasOption('t')) {
Utils.setConfigInteger("threads.size", Integer.parseInt(cl.getOptionValue('t'))); Utils.setConfigInteger("threads.size", Integer.parseInt(cl.getOptionValue('t')));
} }
if (cl.hasOption('4')) { if (cl.hasOption('4')) {
Utils.setConfigBoolean("errors.skip404", true); Utils.setConfigBoolean("errors.skip404", true);
} }
if (cl.hasOption('r')) { if (cl.hasOption('r')) {
// Re-rip all via command-line // Re-rip all via command-line
List<String> history = Utils.getConfigList("download.history"); List<String> history = Utils.getConfigList("download.history");
@ -84,6 +84,16 @@ public class App {
// Exit // Exit
System.exit(0); System.exit(0);
} }
if (cl.hasOption('d')) {
Utils.setConfigBoolean("download.save_order", true);
}
if (cl.hasOption('D')) {
Utils.setConfigBoolean("download.save_order", false);
}
if ((cl.hasOption('d'))&&(cl.hasOption('D'))) {
System.err.println("\nCannot specify '-d' and '-D' simultaneously");
System.exit(-1);
}
if (cl.hasOption('u')) { if (cl.hasOption('u')) {
// User provided URL, rip it. // User provided URL, rip it.
try { try {
@ -117,7 +127,9 @@ public class App {
opts.addOption("t", "threads", true, "Number of download threads per rip"); opts.addOption("t", "threads", true, "Number of download threads per rip");
opts.addOption("w", "overwrite", false, "Overwrite existing files"); opts.addOption("w", "overwrite", false, "Overwrite existing files");
opts.addOption("r", "rerip", false, "Re-rip all ripped albums"); opts.addOption("r", "rerip", false, "Re-rip all ripped albums");
opts.addOption("4", "skip404", false, "Don't retry after a 404 (not found) error"); opts.addOption("d", "saveorder", false, "Save the order of images in album");
opts.addOption("D", "nosaveorder", false, "Don't save order of images");
opts.addOption("4", "skip404", false, "Don't retry after a 404 (not found) error");
return opts; return opts;
} }