Skip to content

Commit

Permalink
Updates options reading workflow to skip first argument as that is th…
Browse files Browse the repository at this point in the history
…e directory path

Signed-off-by: Darshit Chanpura <[email protected]>
  • Loading branch information
DarshitChanpura committed Nov 7, 2023
1 parent cdb2824 commit 882b7cb
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import static org.opensearch.security.support.ConfigConstants.SECURITY_RESTAPI_PASSWORD_VALIDATION_REGEX;
import static org.opensearch.security.user.UserService.generatePassword;

public class InstallDemoConfiguration {
public final class InstallDemoConfiguration {
static boolean assumeyes = false;
static boolean initsecurity = false;
static boolean cluster_mode = false;
Expand Down Expand Up @@ -85,8 +85,8 @@ private static void readArguments(String[] args) {
// set script execution dir
SCRIPT_DIR = args[0];

for (String arg : args) {
switch (arg) {
for (int i=1; i< args.length; i++) {
switch (args[i]) {
case "-y":
assumeyes = true;
break;
Expand All @@ -104,7 +104,7 @@ private static void readArguments(String[] args) {
showHelp();
return;
default:
System.out.println("Invalid option: " + arg);
System.out.println("Invalid option: " + args[i]);
}
}
}
Expand Down

0 comments on commit 882b7cb

Please sign in to comment.