Bugfix in LightOptionParser when handling undefined options.
This commit is contained in:
		@@ -1,6 +1,6 @@
 | 
				
			|||||||
#Sat, 10 Aug 2013 00:00:58 -0500
 | 
					#Sun, 18 Aug 2013 15:42:51 -0500
 | 
				
			||||||
name=jdb-util
 | 
					name=jdb-util
 | 
				
			||||||
version=2.0
 | 
					version=2.1
 | 
				
			||||||
lib.local=true
 | 
					lib.local=true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
build.number=2
 | 
					build.number=0
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -28,12 +28,13 @@ public class LightOptionParser {
 | 
				
			|||||||
            /// Find the definition for this option.
 | 
					            /// Find the definition for this option.
 | 
				
			||||||
            def optDef = optionDefinitions.find {
 | 
					            def optDef = optionDefinitions.find {
 | 
				
			||||||
                it.key == foundName || it.value.longName == foundName }
 | 
					                it.key == foundName || it.value.longName == foundName }
 | 
				
			||||||
            def optName = optDef.key
 | 
					 | 
				
			||||||
            optDef = optDef.value
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (!optDef) throw new IllegalArgumentException(
 | 
					            if (!optDef) throw new IllegalArgumentException(
 | 
				
			||||||
                "Unrecognized option: '${args[optInfo.idx]}.")
 | 
					                "Unrecognized option: '${args[optInfo.idx]}.")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            def optName = optDef.key
 | 
				
			||||||
 | 
					            optDef = optDef.value
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            /// Remember the option index for later.
 | 
					            /// Remember the option index for later.
 | 
				
			||||||
            optionArgIndices << optInfo.idx
 | 
					            optionArgIndices << optInfo.idx
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user