diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 5f7fe46..8e0e436 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -9,8 +9,10 @@
-
+
+
+
@@ -214,7 +216,14 @@
1679344271798
-
+
+ 1679344426853
+
+
+
+ 1679344426853
+
+
@@ -253,7 +262,8 @@
-
+
+
diff --git a/README.md b/README.md
index 1e7fe99..a58c112 100644
--- a/README.md
+++ b/README.md
@@ -12,6 +12,7 @@ Usage: sherly -f inputfolder1 inputfolder2 inputfolder3 [options]...
-h / -help show this
-f / -folder all the folders you want to scan for (see example above!)
-c / -color enable colored messages
+ -t / -threads override default Thread number (default is usually number of cores * 2)
-p / -progress enable progress indicator
-d / -delete delete all dups except one without asking first
-debug debug stuff
diff --git a/src/Main.java b/src/Main.java
index 2430ac2..92a1d33 100644
--- a/src/Main.java
+++ b/src/Main.java
@@ -21,6 +21,8 @@ public class Main {
boolean showProgress = false;
boolean deleteDups = false;
boolean recordFolder = false;
+ boolean recordThreads = false;
+ int saidThreads = 0;
boolean showDebug = false;
boolean help = false;
@@ -33,9 +35,14 @@ public class Main {
paths.add(i);
} else {recordFolder = false;}
}
+ if (recordThreads) {
+ saidThreads = Integer.parseInt(i);
+ recordThreads = false;
+ }
if (i.equalsIgnoreCase("-c") || i.equalsIgnoreCase("-color")) { doTheColorThingy = true;}
if (i.equalsIgnoreCase("-p") || i.equalsIgnoreCase("-progress")) { showProgress = true;}
if (i.equalsIgnoreCase("-f") || i.equalsIgnoreCase("-folder")) { recordFolder = true;}
+ if (i.equalsIgnoreCase("-t") || i.equalsIgnoreCase("-threads")) { recordThreads = true;}
if (i.equalsIgnoreCase("-d") || i.equalsIgnoreCase("-delete")) { deleteDups = true;}
if (i.equalsIgnoreCase("-h") || i.equalsIgnoreCase("-help")) { help = true;}
if (i.equalsIgnoreCase("-debug")) { showDebug = true;}
@@ -48,6 +55,7 @@ public class Main {
System.out.println(" -h / -help show this");
System.out.println(" -f / -folder all the folders you want to scan for (see example above!)");
System.out.println(" -c / -color enable colored messages");
+ System.out.println(" -t / -threads override default Thread number (default is usually number of cores * 2)");
System.out.println(" -p / -progress enable progress indicator");
System.out.println(" -d / -delete delete all dups except one without asking first");
System.out.println(" -debug debug stuff");
@@ -63,6 +71,7 @@ public class Main {
System.out.println("Color: " + doTheColorThingy);
System.out.println("Delete: " + deleteDups);
System.out.println("Progressbar: " + showProgress);
+ System.out.println("Commanded Threads " + saidThreads);
}
@@ -78,10 +87,12 @@ public class Main {
allFiles.addAll(pathList);
}
- // calculations for multithreading
+
+ // calculations for multithreading
//The number of Cores or better said Threads that can be used
int availableThreads = Runtime.getRuntime().availableProcessors();
+ if (saidThreads != 0) {availableThreads = saidThreads;}
//just the number of All Files in all Folders taken from the Args
int filesToBeDone = allFiles.size();