Is there any function in java that behaves like getopt from c

Hello, I am working on a command line application that can take a command line argument like

app -port 8888 -filename d:\xyz\xyz.pdf -dest d:\pqr 

I am looking for a function that can return a couple of parameters to me, and this value corresponds to getopt in c.

+7
source share
2 answers

For Java, there are quite a few command line parser libraries. Probably the most popular are commons-cli (fairly old), args4j and JCommander . Also consider this question in Stackoverflow.

+5
source

The first Google result for "getopt java" is the C port of getopt for java:

http://www.urbanophile.com/~arenn/hacking/download.html

+2
source

All Articles