How to fetch parameters when using the Apache Commons CLI library

Posted by Mridang Agarwalla on Stack Overflow See other posts from Stack Overflow or by Mridang Agarwalla
Published on 2011-01-14T09:12:19Z Indexed on 2011/01/14 17:54 UTC
Read the original article Hit count: 196

Filed under:
|

I'm using the Apache Commons CLI to handle command line arguments in Java. I've figured out my way around it to a decent extent but I need a little help. 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?

Thank you.

© Stack Overflow or respective owner

Related posts about java

Related posts about apache-commons