These days i am working for my main phd project and i decided to use (for the first time in my life, i have to admit) the famous GNU GetOpt. I downloaded it from the FSF website and began to use it. First impressions were perfect, lean and mean design, support for short and long switches, the gnu way, such as:
myprogram -s dir/
The good news stop here. The API is a little deprecated for a modern programming language, and the only way to use it effectively is to wrap it with higher level data structures. It seems to ignore them completely, so everyone that has to build a parser should re-implement custom code for low level parsing like:
Getopt g = new Getopt("testprog", argv, "ab:c::d");

int c;
String arg;
while ((c = g.getopt()) != -1) {
switch(c) {
          case 'a':
          case 'd':
            System.out.print("You picked " + (char)c + "\n");
          case 'b':
          case 'c':
            arg = g.getOptarg();
            System.out.print("You picked " + (char)c + 
                             " with an argument of " +
                             ((arg != null) ? arg : "null") + "\n");
          case '?':
            break; // getopt() already printed an error
            System.out.print("getopt() returned " + c + "\n");
If you want support for long switches, you have to use longOpt:
 StringBuffer sb = new StringBuffer();
 longopts[0] = new LongOpt("help", LongOpt.NO_ARGUMENT, null, 'h');
 longopts[1] = new LongOpt("outputdir", LongOpt.REQUIRED_ARGUMENT, sb, 'o'); 
 longopts[2] = new LongOpt("maximum", LongOpt.OPTIONAL_ARGUMENT, null, 2);
 Getopt g = new Getopt("testprog", argv, "-:bc::d:hW;", longopts);
 g.setOpterr(false); // We'll do our own error handling
I think the above code is a tragedy in the making, since it combines high level abstractions like classes for representing the long options with low level alphanumeric representation "-:bc::d:hw;". The verdict is that is just removed it from my code (after a few hours that i tried to make it work correctly, and it worked) and implemented a library that is also two classes and works with the principles that GetOpt dont.

Don't know if i am biased about this, i will publish it soon in Programming / Software web page to judge on your own.