Skip to content

Commit

Permalink
Allow checking if arguments conform strictly to requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
Skaty committed Oct 26, 2016
1 parent f090c3e commit 253641a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/main/java/seedu/task/logic/parser/BaseParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ protected void addToArgumentsTable(String keyword, String value) {
}

arrayItems.add(value);
System.out.println(keyword + ": " + value);
argumentsTable.put(keyword, arrayItems);
}

Expand Down Expand Up @@ -91,8 +90,12 @@ protected boolean checkForRequiredArguments(String[] requiredArgs, String[] opti
numOptional++;
}
}

return argumentsTable.size() >= numOptional + requiredArgs.length;

if (isStrictSet) {
return argumentsTable.size() == numOptional + requiredArgs.length;
} else {
return argumentsTable.size() >= numOptional + requiredArgs.length;
}
}

/**
Expand Down

0 comments on commit 253641a

Please sign in to comment.