commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David M. Karr" <>
Subject [CLI] How to determine whether an arg is provided for an "optionalArg" option?
Date Tue, 02 Feb 2016 20:26:35 GMT
I was looking at the Groovy CliBuilder class, but I noticed that it 
appears to use Commons CLI under the covers, so perhaps my question is 
better addressed here.

Someone had asked me, for an option where "optionalArg" is true, how do 
you tell whether a value was provided?  When I do this in Groovy, if I 
provide a value, the value of the option gives me the value that was 
provided, but if I don't provide a value, Groovy just gives me a boolean 
true for the value of the option.  I didn't see any method like 
"argWasProvided" or anything like that.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message