Anvil/bash-argsparse

simultaneous exclude and default attribute issue

mxcarron opened this issue · 3 comments

Hello,

If two options are mutually exclusive (exclude property) and the first one has a default value, the second one is "unavailable", since default always set a value.

Example :
argsparse_use_option option1 "desc option1" value default:toto exclude:option2
argsparse_use_option option2 "desc option2" exclude:option1

Should be fixed in commits 2636df0...df25dc3

As a side effect, default values will now honor the the cumulative property.

I've slightly changed the implementation, but the bad behavior you've reported has been fixed in 1.6.
argsparse_has_option_property <option name> default will now work too.