I am using argparse4j to parse command line arguments. I want to add an argument that when present, sets a boolean to true, otherwise it defaults to false. I don't want to include the true or false in the argument, just the identifier, so it would look something like this when run:
java firstArg --enable-boolean
This answer shows that in Python, I could set the action
of the argument to store a true or false value like so:
parser.add_argument('-b', action='store_true', default=False)
How can I do the same thing in Java, using argparse4j?