len += (sep.length() + 2 + opt.longOption.length());
{ len += (sep.length() + UsageInfo.LONG_OPTION_PREFIX.length() + opt.longOption.length()); }
    protected final void usage (String prefixMsg)    {        WordWrapWriter  out = new WordWrapWriter (System.err);        String[]        strings;        Iterator        it;        int             i;        int             maxParamLength = 0;        int             maxOptionLength = 0;        String          s;        StringBuffer    usageLine = new StringBuffer();        OptionInfo[]    options;        OptionInfo      opt;        if (prefixMsg != null)        {            out.println();            out.println (prefixMsg);            out.println();        }        // Now, print the summary line.        usageLine.append ("java ");        usageLine.append (getClass().getName());        usageLine.append (" [options]");        // Add the parameter placeholders. We'll also calculate the maximum        // parameter name length in this loop, to save an iteration later.        strings = usageInfo.getParameterNames();        if (strings.length > 0)        {            for (i = 0; i < strings.length; i++)            {                usageLine.append (' ');                boolean optional = true;                if (usageInfo.parameterIsRequired (strings[i]))                    optional = false;                if (optional)                    usageLine.append ('[');                usageLine.append (strings[i]);                if (optional)                    usageLine.append (']');                maxParamLength = Math.max (maxParamLength,                                           strings[i].length() + 1);            }        }        if ( (s = usageInfo.getUsagePrologue()) != null)            out.println (s);        out.setPrefix ("Usage: ");        out.println (usageLine.toString());        out.setPrefix (null);        out.println ();        // Find the largest option name.        out.println ("OPTIONS:");        out.println ();        maxOptionLength = 2;        options = usageInfo.getOptions();        for (i = 0; i < options.length; i++)        {            opt = options[i];            if (opt.longOption != null)            {                // Allow room for short option, long option and argument,                // if any.                //                // -x, --long-x <arg>                int    len = 0;                String sep = "";                if (opt.shortOption != UsageInfo.NO_SHORT_OPTION)                {                    len = 2;    // -x                    sep = ", ";                }                if (opt.longOption != null)                    len += (sep.length() + 2 + opt.longOption.length());                if (opt.argToken != null)                    len += (opt.argToken.length() + 1);                maxOptionLength = Math.max (maxOptionLength, len + 1);            }        }        // Now, print the options.        StringBuffer optString = new StringBuffer();        for (i = 0; i < options.length; i++)        {            // If there's a short option, print it first. Then do the            // long one.            opt = options[i];            optString.setLength (0);            String sep = "";            if (opt.shortOption != UsageInfo.NO_SHORT_OPTION)            {                optString.append ('-');                optString.append (opt.shortOption);                sep = ", ";            }            if (opt.longOption != null)            {                optString.append (sep);                optString.append ("--");                optString.append (opt.longOption);                if (opt.argToken != null)                {                    optString.append (' ');                    optString.append (opt.argToken);                }                out.setPrefix (padString (optString.toString(),                                          maxOptionLength));                out.println (opt.explanation);            }            out.setPrefix (null);        }        // Print the parameters. We already have size of the the largest        // parameter name.        strings = usageInfo.getParameterNames();        if (strings.length > 0)        {            out.println ();            out.println ("PARAMETERS:");            out.println ();            // Now, print the parameters.            for (i = 0; i < strings.length; i++)            {                out.setPrefix (padString (strings[i], maxOptionLength));                out.println (usageInfo.getParameterExplanation (strings[i]));                out.setPrefix (null);            }        }        if ( (s = usageInfo.getUsageTrailer()) != null)            out.println (s);        out.flush();    }