Skip to content

Commit

Permalink
Add helper method
Browse files Browse the repository at this point in the history
  • Loading branch information
fullwall committed Apr 26, 2019
1 parent 943714b commit 8911546
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/main/java/net/citizensnpcs/api/command/CommandContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,15 @@ public boolean hasAnyFlags() {
return valueFlags.size() > 0 || flags.size() > 0;
}

public boolean hasAnyValueFlag(String... strings) {
for (String s : strings) {
if (hasValueFlag(s)) {
return true;
}
}
return false;
}

public boolean hasFlag(char ch) {
return flags.contains(ch);
}
Expand Down Expand Up @@ -314,6 +323,5 @@ public static Location parseLocation(Location currentLocation, String flag) thro

private static final Pattern FLAG = Pattern.compile("^-[a-zA-Z]+$");
private static final Splitter LOCATION_SPLITTER = Splitter.on(Pattern.compile("[,]|[:]")).omitEmptyStrings();

private static final Pattern VALUE_FLAG = Pattern.compile("^--[a-zA-Z0-9-]+$");
}

0 comments on commit 8911546

Please sign in to comment.