this.programName = programName; this.longOnly = longOnly;   OptionGroup finalGroup = new OptionGroup(Messages.getString("Parser.StdOptions")); finalGroup.add(new Option("help", Messages.getString("Parser.PrintHelp")) { public void parsed(String argument) throws OptionException { printHelp(System.out); System.exit(0); } }); finalGroup.add(new Option("version", Messages.getString("Parser.PrintVersion")) { public void parsed(String argument) throws OptionException { System.out.println(versionString); System.exit(0); } }); finalGroup.add(new Option('J', Messages.getString("Parser.JArgument"), Messages.getString("Parser.JName")) { public void parsed(String argument) throws OptionException {    } }); add(finalGroup);  add(defaultGroup);
this(programName, versionString, false);
  public Parser(String programName, final String versionString, boolean longOnly)  {    this.programName = programName;    this.longOnly = longOnly;    // Put standard options in their own section near the end.    OptionGroup finalGroup = new OptionGroup(Messages.getString("Parser.StdOptions")); //$NON-NLS-1$    finalGroup.add(new Option("help", Messages.getString("Parser.PrintHelp")) //$NON-NLS-1$ //$NON-NLS-2$    {      public void parsed(String argument) throws OptionException      {        printHelp(System.out);        System.exit(0);      }    });    finalGroup.add(new Option("version", Messages.getString("Parser.PrintVersion")) //$NON-NLS-1$ //$NON-NLS-2$    {      public void parsed(String argument) throws OptionException      {        System.out.println(versionString);        System.exit(0);      }    });    finalGroup.add(new Option('J', Messages.getString("Parser.JArgument"), Messages.getString("Parser.JName")) //$NON-NLS-1$ //$NON-NLS-2$    {      public void parsed(String argument) throws OptionException      {        // -J should be handled by the appletviewer wrapper binary.        // We add it here so that it shows up in the --help output.        // Note that there is a special case for this in OptionGroup.      }    });    add(finalGroup);    add(defaultGroup);  }