Skip to content

Commit

Permalink
fix arguments bug
Browse files Browse the repository at this point in the history
Signed-off-by: issacto <[email protected]>
  • Loading branch information
issacto committed Jun 27, 2023
1 parent 171f516 commit 110129c
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,7 @@ private void processCommandLineArgumentArray(String[] args) {

public void loadArgProgramPaths(){
String applicationSourceDirectory = Config.getApplicationSourceDirectoryPathString();
if(options.isEmpty()){
// return error when no program is passed
throw new CommandLineArgumentException(Messages.get("ERR030"));
}
boolean isProgramSpecified = false;
for (OptionKey optionKey : options.keySet()) {
if (optionKey.shortKey.equals(Constants.PROGRAMS_OPTION) || optionKey.longKey.equals(Constants.PROGRAMS_OPTION)) {
String programArgs = options.get(optionKey).argumentValue;
Expand All @@ -156,8 +153,13 @@ public void loadArgProgramPaths(){
newValue += "|";
}
options.get(optionKey).argumentValue = newValue.substring(0, newValue.length()-1);
if(!programArgs.equals("")) isProgramSpecified = true;
}
}
if(!isProgramSpecified){
// return error when no program is passed
throw new CommandLineArgumentException(Messages.get("ERR030"));
}
}

private OptionValue lookupOption(String requestedOption) {
Expand Down

0 comments on commit 110129c

Please sign in to comment.