Added -h / -help option for better usability

This commit is contained in:
Lia Brüggemann 2023-03-20 20:40:36 +01:00
parent e78234243f
commit 941a6e10f9
2 changed files with 37 additions and 13 deletions

37
.idea/workspace.xml generated
View file

@ -9,7 +9,8 @@
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="9b57ac51-c870-474b-9dfd-64a5fc490635" name="Changes" comment="Added Number of files in -d option">
<list default="true" id="9b57ac51-c870-474b-9dfd-64a5fc490635" name="Changes" comment="Added -h / -help option for better usability">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Main.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Main.java" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
@ -34,6 +35,9 @@
</list>
</option>
</component>
<component name="GithubDefaultAccount">
<option name="defaultAccountId" value="1ec83841-9eac-4bec-b8b8-e821355f624e" />
</component>
<component name="GithubPullRequestsUISettings">
<option name="selectedUrlAndAccountId">
<UrlAndAccount>
@ -51,22 +55,28 @@
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent">{
&quot;keyToString&quot;: {
&quot;RunOnceActivity.OpenProjectViewOnStart&quot;: &quot;true&quot;,
&quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
&quot;SHARE_PROJECT_CONFIGURATION_FILES&quot;: &quot;true&quot;,
&quot;last_opened_file_path&quot;: &quot;/home/bly/IdeaProjects/Sherly&quot;,
&quot;project.structure.last.edited&quot;: &quot;Artifacts&quot;,
&quot;project.structure.proportion&quot;: &quot;0.15&quot;,
&quot;project.structure.side.proportion&quot;: &quot;0.2&quot;
<component name="PropertiesComponent"><![CDATA[{
"keyToString": {
"RunOnceActivity.OpenProjectViewOnStart": "true",
"RunOnceActivity.ShowReadmeOnStart": "true",
"SHARE_PROJECT_CONFIGURATION_FILES": "true",
"last_opened_file_path": "/home/bly/IdeaProjects/Sherly",
"project.structure.last.edited": "Artifacts",
"project.structure.proportion": "0.15",
"project.structure.side.proportion": "0.2",
"settings.editor.selected.configurable": "vcs.Git"
}
}</component>
}]]></component>
<component name="RunAnythingCache">
<option name="myCommands">
<command value="github" />
</option>
</component>
<component name="RunManager">
<configuration name="Main" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="Main" />
<module name="Sherly" />
<option name="PROGRAM_PARAMETERS" value="-f $USER_HOME$/Pictures/ -p -d" />
<option name="PROGRAM_PARAMETERS" value="-f $USER_HOME$/Pictures/ -p -h" />
<method v="2">
<option name="Make" enabled="true" />
</method>
@ -213,7 +223,8 @@
<MESSAGE value="Fixed another Random Crash that happened when a file size is near 0" />
<MESSAGE value="Simplify code in ThreadedCompare.java and added option for debuging with -debug" />
<MESSAGE value="Added Number of files in -d option" />
<option name="LAST_COMMIT_MESSAGE" value="Added Number of files in -d option" />
<MESSAGE value="Added -h / -help option for better usability" />
<option name="LAST_COMMIT_MESSAGE" value="Added -h / -help option for better usability" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager>

View file

@ -22,6 +22,7 @@ public class Main {
boolean deleteDups = false;
boolean recordFolder = false;
boolean showDebug = false;
boolean help = false;
List<String> paths = new ArrayList<>();
@ -36,10 +37,22 @@ public class Main {
if (i.equalsIgnoreCase("-p") || i.equalsIgnoreCase("-progress")) { showProgress = true;}
if (i.equalsIgnoreCase("-f") || i.equalsIgnoreCase("-folder")) { recordFolder = 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;}
}
if (help) {
System.out.println("Usage: sherly -f inputfolder1 inputfolder2 inputfolder3 [options]...");
System.out.println(" ");
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(" -p / -progress enable progress indicator");
System.out.println(" -d / -delete delete all found duplicates except one");
System.out.println(" -debug debug stuff");
return;
}
if (paths.size() == 0) {
System.out.println("Aborted, no Folders Found!");
return;