Bugfix in LightOptionParser when handling undefined options.

This commit is contained in:
Jonathan Bernard
2013-08-18 15:43:48 -05:00
parent 3668a9e112
commit 3fcc28d4ed
2 changed files with 6 additions and 5 deletions

View File

@ -28,12 +28,13 @@ public class LightOptionParser {
/// Find the definition for this option.
def optDef = optionDefinitions.find {
it.key == foundName || it.value.longName == foundName }
def optName = optDef.key
optDef = optDef.value
if (!optDef) throw new IllegalArgumentException(
"Unrecognized option: '${args[optInfo.idx]}.")
def optName = optDef.key
optDef = optDef.value
/// Remember the option index for later.
optionArgIndices << optInfo.idx