Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the best way of parsing many complex command-line arguments in Java?

I have used getopt in Python and was hoping there would be something similar in Java.

Please give a reason why your answer is better than the others.

like image 557
Liam Avatar asked Oct 16 '08 08:10

Liam


People also ask

How many command line arguments can be passed to a 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. You can pass N (1,2,3 and so on) numbers of arguments from the command prompt.

How are command line arguments handled Java?

Java command line arguments are arguments that are passed to your program via a terminal or shell command. They make your Java program more configurable by giving users or scripts running your software a way to specify input parameters at run time.


1 Answers

Commons CLI

like image 86
Chris Jester-Young Avatar answered Sep 22 '22 16:09

Chris Jester-Young