Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are there good Java libraries that facilitate building command-line applications? [closed]

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.

like image 269
carrier Avatar asked Jan 12 '09 15:01

carrier


People also ask

What is command-line application in Java?

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.

What does the Java standard library include?

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.


1 Answers

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").

like image 146
Kevin ORourke Avatar answered Oct 10 '22 14:10

Kevin ORourke