Updated LICENSE, changed package to net.chaoticbyte.xxsherly, reimplemented cli argument -n/-noinput

This commit is contained in:
Julian Müller (ChaoticByte) 2023-05-05 21:18:31 +02:00
parent 5b77b2de6f
commit 98cbb525ca
6 changed files with 11 additions and 6 deletions

View file

@ -1,6 +1,7 @@
BSD 2-Clause License BSD 2-Clause License
Copyright (c) 2023, Lia Brüggemann Copyright (c) 2023, Lia Brüggemann
Copyright (c) 2023, Julian Müller (ChaoticByte)
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met: modification, are permitted provided that the following conditions are met:

View file

@ -17,6 +17,7 @@ Usage: sherly -f inputfolder1 inputfolder2 inputfolder3 [options]...
-t / -threads override default Thread number (default is usually number of cores * 2) -t / -threads override default Thread number (default is usually number of cores * 2)
-p / -progress enable progress indicator -p / -progress enable progress indicator
-d / -delete delete all dups except one without asking first -d / -delete delete all dups except one without asking first
-n / -noinput skip all user input
-debug debug stuff -debug debug stuff
``` ```

View file

@ -4,7 +4,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>com.blydoescoding.sherly</groupId> <groupId>net.chaoticbyte.xxsherly</groupId>
<artifactId>xxSherly</artifactId> <artifactId>xxSherly</artifactId>
<version>1.0</version> <version>1.0</version>
@ -55,7 +55,7 @@
<configuration> <configuration>
<archive> <archive>
<manifest> <manifest>
<mainClass>com.blydoescoding.sherly.App</mainClass> <mainClass>net.chaoticbyte.xxsherly.App</mainClass>
</manifest> </manifest>
</archive> </archive>
</configuration> </configuration>

View file

@ -1,4 +1,4 @@
package com.blydoescoding.sherly; package net.chaoticbyte.xxsherly;
import java.io.IOException; import java.io.IOException;
import java.nio.file.Files; import java.nio.file.Files;
@ -26,6 +26,7 @@ public class App {
boolean recordThreads = false; boolean recordThreads = false;
int saidThreads = 0; int saidThreads = 0;
boolean showDebug = false; boolean showDebug = false;
boolean noInput = false;
boolean help = false; boolean help = false;
List<String> paths = new ArrayList<>(); List<String> paths = new ArrayList<>();
@ -45,6 +46,7 @@ public class App {
if (i.equalsIgnoreCase("-f") || i.equalsIgnoreCase("-folder")) { recordFolder = true;} if (i.equalsIgnoreCase("-f") || i.equalsIgnoreCase("-folder")) { recordFolder = true;}
if (i.equalsIgnoreCase("-t") || i.equalsIgnoreCase("-threads")) { recordThreads = true;} if (i.equalsIgnoreCase("-t") || i.equalsIgnoreCase("-threads")) { recordThreads = true;}
if (i.equalsIgnoreCase("-d") || i.equalsIgnoreCase("-delete")) { deleteDups = true;} if (i.equalsIgnoreCase("-d") || i.equalsIgnoreCase("-delete")) { deleteDups = true;}
if (i.equalsIgnoreCase("-n") || i.equalsIgnoreCase("-noinput")) { noInput = true; }
if (i.equalsIgnoreCase("-h") || i.equalsIgnoreCase("-help")) { help = true;} if (i.equalsIgnoreCase("-h") || i.equalsIgnoreCase("-help")) { help = true;}
if (i.equalsIgnoreCase("-debug")) { showDebug = true;} if (i.equalsIgnoreCase("-debug")) { showDebug = true;}
@ -59,6 +61,7 @@ public class App {
System.out.println(" -t / -threads override default Thread number (default is usually number of cores * 2)"); 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(" -p / -progress enable progress indicator");
System.out.println(" -d / -delete delete all dups except one without asking first"); System.out.println(" -d / -delete delete all dups except one without asking first");
System.out.println(" -n / -noinput skip all user input");
System.out.println(" -debug debug stuff"); System.out.println(" -debug debug stuff");
return; return;
} }
@ -172,7 +175,7 @@ public class App {
if (deleteDups) { if (deleteDups) {
delete(allTheFilesWillBeDeleted); delete(allTheFilesWillBeDeleted);
} else { } else if (!noInput) {
ask(doTheColorThingy, bytes, allTheFilesWillBeDeleted); ask(doTheColorThingy, bytes, allTheFilesWillBeDeleted);
} }

View file

@ -1,4 +1,4 @@
package com.blydoescoding.sherly; package net.chaoticbyte.xxsherly;
// Just regular Colors to make it a bit prettier // Just regular Colors to make it a bit prettier

View file

@ -1,4 +1,4 @@
package com.blydoescoding.sherly; package net.chaoticbyte.xxsherly;
import java.io.*; import java.io.*;
import java.nio.file.Path; import java.nio.file.Path;