Discussion Locked

Make command line arguments the easy way

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
Tell us what you think about our tip on command line arguments in Java.

3 replies

by james.cakalic

I was a bit surprised that the article ended as quickly as it did. I was expecting to be referred to any number of Java implementations of command line parsing packages. As a Unix/C programmer, I found the getopt family of functions indispensable inwriting programs that had to interpret command line options. There is a Java port of the package available at http://www.urbanophile.com/arenn/hacking/download.html.

by bayard-generationjava

Thanks for the note James. I agree that it ended shortly. The tip is aimed to show that you can slip arguments through without needing to use getopt style libraries.

I aim to write an article on Jakarta Commons CLI, the unified Jakarta command line parser. I've dropped my own CArgs class in favour of this and believe it to be far superior to the alternatives.

Java ports of getopt have always unimpressed me as I feel getopt to be have a very limited set of functionality in C. I'll attemptto make this point in an article :)

Thanks

by tidwelld

i made a class outta the ShowAll code of the email.
but the part about the -Dflag=jack.i would like to see the class ShowFlag declared public or put into an working example.
dean

This discussion is closed to new replies.