Reputation: 1412
Hello I am working on command line application which can accepts command line argument like
app -port 8888 -filename d:\xyz\xyz.pdf -dest d:\pqr
I am looking for function which can return me pair of option and it corresponding value like getopt in c.
Upvotes: 17
Views: 13502
Reputation: 5265
There are quite a few command line parser libraries for Java out there.
A recent (as of late 2019) command line parser with a lot of momentum and features is picocli.
Some older, popular ones are commons-cli (quite old), args4j and JCommander.
Upvotes: 14