Skip to content

Commit

Permalink
fix(CI): Fixed linter issues for switch case statements
Browse files Browse the repository at this point in the history
  • Loading branch information
SaptarshiSarkar12 committed Nov 28, 2023
1 parent 7d1fe10 commit b953bd3
Showing 1 changed file with 20 additions and 23 deletions.
43 changes: 20 additions & 23 deletions src/main/java/CLI/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,29 +59,26 @@ public static void main(String[] args) {
String location = null;
if (args.length > 0) {
for (int i = 0; i < args.length; i++) {
switch (args[i]) {
case HELP_FLAG, HELP_FLAG_SHORT -> {
help();
System.exit(0);
}
case NAME_FLAG, NAME_FLAG_SHORT -> name = args[i + 1];
case LOCATION_FLAG, LOCATION_FLAG_SHORT -> location = args[i + 1];
case VERSION_FLAG, VERSION_FLAG_SHORT -> {
printVersion();
System.exit(0);
}
case BATCH_FLAG, BATCH_FLAG_SHORT -> {
batchDownloading = true;
batchDownloadingFile = args[i + 1];
batchDownloader();
}
default -> {
if (isURL(args[i])) {
link = args[i];
} else {
messageBroker.msgInitError("Invalid argument(s) passed!");
System.exit(1);
}
if (args[i].equals(HELP_FLAG) || args[i].equals(HELP_FLAG_SHORT)) {
help();
System.exit(0);
} else if (args[i].equals(NAME_FLAG) || args[i].equals(NAME_FLAG_SHORT)) {
name = args[i + 1];
} else if (args[i].equals(LOCATION_FLAG) || args[i].equals(LOCATION_FLAG_SHORT)) {
location = args[i + 1];
} else if (args[i].equals(VERSION_FLAG) || args[i].equals(VERSION_FLAG_SHORT)) {
printVersion();
System.exit(0);
} else if (args[i].equals(BATCH_FLAG) || args[i].equals(BATCH_FLAG_SHORT)) {
batchDownloading = true;
batchDownloadingFile = args[i + 1];
batchDownloader();
} else {
if (isURL(args[i])) {
link = args[i];
} else {
messageBroker.msgInitError("Invalid argument(s) passed!");
System.exit(1);
}
}
}
Expand Down

1 comment on commit b953bd3

@vercel
Copy link

@vercel vercel bot commented on b953bd3 Nov 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.