Skip to content
This repository was archived by the owner on Aug 6, 2024. It is now read-only.

Commit e6703c6

Browse files
committed
argument handler is now generic
1 parent c0068b6 commit e6703c6

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

pom.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,5 +97,16 @@
9797
</plugin>
9898
</plugins>
9999
</pluginManagement>
100+
<plugins>
101+
<plugin>
102+
<groupId>org.apache.maven.plugins</groupId>
103+
<artifactId>maven-compiler-plugin</artifactId>
104+
<configuration>
105+
<source>17</source>
106+
<target>17</target>
107+
<compilerArgs>--enable-preview</compilerArgs>
108+
</configuration>
109+
</plugin>
110+
</plugins>
100111
</build>
101112
</project>

src/main/java/ir/xenoncommunity/MainRunner.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,9 @@ public void run(){
99
System.out.println((String) ArgumentHandler.getArg("-kir"));
1010
System.out.println((int) ArgumentHandler.getArg("-kos"));
1111
System.out.println((boolean) ArgumentHandler.getArg("-kiramtot"));
12+
System.out.println((boolean) ArgumentHandler.getArg("-kosam"));
13+
System.out.println((boolean) ArgumentHandler.getArg("-kooooos"));
14+
System.out.println((boolean) ArgumentHandler.getArg("-rot"));
15+
1216
}
1317
}

src/main/java/ir/xenoncommunity/utils/ArgumentHandler.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import ir.xenoncommunity.Main;
44
import lombok.val;
55
import lombok.experimental.UtilityClass;
6-
import lombok.var;
76

87
@UtilityClass
98
public class ArgumentHandler {
@@ -12,7 +11,7 @@ public <T> T getArg(final String argIn) {
1211
if(Main.args[index].equals(argIn)) {
1312
var temp = (index + 1 < Main.args.length) ? (Main.args[index + 1]) : ("");
1413
if(temp.startsWith("-") ) {
15-
return (T) Boolean.valueOf(Boolean.parseBoolean(Main.args[index]));
14+
return (T) Boolean.valueOf(true);
1615
}else {
1716
switch(temp){
1817
case "":

0 commit comments

Comments
 (0)