add some simple arg parsing

This commit is contained in:
Chloe Fontenot 🏳️‍⚧️ 2022-11-29 20:00:17 -06:00
parent be776d5d57
commit ecf1907b3e
15 changed files with 11 additions and 2 deletions

Binary file not shown.

Binary file not shown.

2
.idea/misc.xml generated
View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" /> <component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" project-jdk-name="temurin-19" project-jdk-type="JavaSDK"> <component name="ProjectRootManager" version="2" languageLevel="JDK_17" project-jdk-name="17" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" /> <output url="file://$PROJECT_DIR$/out" />
</component> </component>
</project> </project>

View File

@ -3,6 +3,11 @@ plugins {
id 'application' id 'application'
} }
apply plugin : "java"
ext {
javaMainClass = "com.calebfontenot.Main"
}
group 'com.calebfontenot' group 'com.calebfontenot'
version '1.0-SNAPSHOT' version '1.0-SNAPSHOT'
@ -26,7 +31,7 @@ test {
} }
application { application {
mainClassName = project.hasProperty("mainClass") ? project.getProperty("mainClass") : "NULL" mainClassName = javaMainClass
} }
jar { jar {
manifest { manifest {

View File

@ -7,6 +7,9 @@ import org.json.*;
public class Main { public class Main {
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
for (int i = 0; i < args.length; i++) {
System.out.println("args used: " + args[i]);
}
System.out.println("CURLing API..."); System.out.println("CURLing API...");
URL url = new URL("https://api.papermc.io/v2/projects"); URL url = new URL("https://api.papermc.io/v2/projects");
@ -18,6 +21,7 @@ public class Main {
for (int i = 0; i < projects.length() - 1; i++) { for (int i = 0; i < projects.length() - 1; i++) {
System.out.println(projects.get(i)); System.out.println(projects.get(i));
} }
} }
} }
} }