Implemented -? and changed handling of InvalidUsageException.

Fixes WORLDEDIT-2947.
This commit is contained in:
sk89q
2014-06-30 22:48:04 -07:00
parent c29ca03e35
commit 11d37bce2b
8 changed files with 138 additions and 63 deletions

View File

@ -145,7 +145,7 @@ public class CommandContext {
suggestionContext = SuggestionContext.hangingValue();
// Not a flag?
if (arg.charAt(0) != '-' || arg.length() == 1 || !arg.matches("^-[a-zA-Z]+$")) {
if (arg.charAt(0) != '-' || arg.length() == 1 || !arg.matches("^-[a-zA-Z\\?]+$")) {
if (!isHanging) {
suggestionContext = SuggestionContext.lastValue();
}

View File

@ -66,7 +66,7 @@ public class CommandException extends Exception {
}
builder.append(spacedSuffix);
}
return builder.toString();
return builder.toString().trim();
}
}