I need to write a simple command-line application in Java. It would be nice to use a library that takes care of parsing commands and takes care of things like flags and optional/mandatory parameters...
UPDATE
Something that has built-in TAB completion would be particularly great.
The java command-line argument is an argument i.e. passed at the time of running the java program. The arguments passed from the console can be received in the java program and it can be used as an input. So, it provides a convenient way to check the behavior of the program for the different values.
Java provides a rich set of libraries, and its standard Java library is a very powerful that contains libraries such as java. lang, java. util, and java.
I've used the Apache Commons CLI library for command-line argument parsing. It's fairly easy to use and has reasonably good documentation.
Which library you choose probably comes down to which style of options you prefer ("--gnu-style" or "-javac-style").
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