From ad78c78ec380da1e9a52da911c5c1e2d824a8f38 Mon Sep 17 00:00:00 2001 From: Dimtree Date: Tue, 23 Dec 2014 23:19:52 -0500 Subject: [PATCH] Added -d and -D flags, formatting added -d (--saveorder) and -D (--nosaveorder) flags to control 'download.save_order' from the command line. Replaced some tabs with spaces. --- src/main/java/com/rarchives/ripme/App.java | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/rarchives/ripme/App.java b/src/main/java/com/rarchives/ripme/App.java index 21781a97..1a8f5f3a 100644 --- a/src/main/java/com/rarchives/ripme/App.java +++ b/src/main/java/com/rarchives/ripme/App.java @@ -60,9 +60,9 @@ public class App { if (cl.hasOption('t')) { Utils.setConfigInteger("threads.size", Integer.parseInt(cl.getOptionValue('t'))); } - if (cl.hasOption('4')) { - Utils.setConfigBoolean("errors.skip404", true); - } + if (cl.hasOption('4')) { + Utils.setConfigBoolean("errors.skip404", true); + } if (cl.hasOption('r')) { // Re-rip all via command-line List history = Utils.getConfigList("download.history"); @@ -84,6 +84,16 @@ public class App { // Exit 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')) { // User provided URL, rip it. try { @@ -117,7 +127,9 @@ public class App { opts.addOption("t", "threads", true, "Number of download threads per rip"); opts.addOption("w", "overwrite", false, "Overwrite existing files"); 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; }