I'm using the Apache Commons CLI to handle command line arguments in Java.
I've declared the a and b options and I'm able to access the value using CommandLine.getOptionValue().
Usage: myapp [OPTION] [DIRECTORY]  Options: -a        Option A -b        Option B   How do I declare and access the DIRECTORY variable?
Use the following method:
CommandLine.getArgList()   which returns whatever's left after options have been processed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With