Closed tomasbjerre closed 8 years ago
In https://github.com/Softhouse/jargo/blob/06b7b4abe0b94c286ac00cd989d36dd141dee8ed/jargo/src/test/java/se/softhouse/jargo/stringparsers/OptionalArgumentTest.java there is a test:
@Test
public void testThatOptionalIsFalseWhenArgumentIsGivenAndDefaultIsTrue() throws ArgumentException
{
assertThat(optionArgument("--disable-logging").defaultValue(true).parse("--disable-logging")).isFalse();
}
Perhaps you're passing in the wrong string arguments?
Ok, I'll just use wasGiven, it returns what I would expect get to return.
When I do:
"enableLogging" cannot be set to false? If I dont supply the argument it will default to true, if I supply it it will be set to true. I must use defaultValue null or false, otherwise there is no way of setting it to false?
Perhaps optionArgument should not have a default value?