kohsuke/args4j

option to have both value and boolean

germayneng opened this issue · 1 comments

So the use case is as such:

  1. if user defines this e.g -v and does not give any value, default to a number 5.

  2. If user defines this -v and provides value , set var to the provided value

  3. user does not define this. ignore this command

For this use case, i cant seem to have any way to implement this. Am i missing something? if i set the default for v to be 5, then it is not correct as it should not have any value if the user did not parse -v. Boolean handles this but i am not able to have a different value if the user wants to

Edit: A workaround i did was to make use of the @argument but this may not be full-proof