hello Tom,

On Wednesday 10 May 2006 01:10, Tom Tromey wrote:
> >>>>> "Raif" == Raif S Naffah <[EMAIL PROTECTED]> writes:
> ...
> Raif> Index: Parser.java
>
> Raif> +  private void printText(PrintStream out, String text)
> Raif> +  {
>
> Raif> +        // is there a newline in the substring
> [start..finish]?
>
> If we're implementing line wrapping then we shouldn't need newlines
> in the text in the first place, should we?

i wanted to handle the cases where the description text for an option is 
more than one paragraph.  looking at more commands' help i didn't find 
any that has such a feature.

i guess i can re-write the tool's help to be more terse.


> It seems to me that we should just ensure that the input strings here
> are properly formatted to 80 characters.  That can be done in the
> source and by the translators.  Then we don't need wrapping support
> in Parser at all.

many commands do have description text that span more one line; e.g. cp.  
i think we should support wrapping.


> Raif> +    if (longOnly)
> Raif> +      printHelpLongOnly(out);
> Raif> +    else
> Raif> +      printHelp(out);
>
> I'd rather not have a second method for printHelpLongOnly.
> "Long only" is actually a misnomer left over from GNU getopt -- the
> short form of options is still supported and should still be
> documented in the help output.
>
> So instead this should just be a flag on printHelp.

the longOnly print-help method is for commands which options do not have 
short-form syntax; e.g. jarsigner.  those commands signal their 
intention with the Parser constructor that takes a boolean as its last 
argument.

handling of short+long options is left in the initial method.

we'll probably end up re-using code between those two methods but for a 
start it was easier to work on this as a separate method.


> One thing that is still missing is nice support for the case when the
> help overflows a line.  I think your code here isn't sufficient,
> though, in that we would want to indent following lines to the start
> of long text properly.  Here is an example from 'cp --help'...

i will fix that.


> One concern I have is that wrapping is a pain to get right across
> Locales, and even in English if there is quoted text.  But maybe we
> can just try it and see...

indeed.


i'll work on a revised patch tonight.


thanks for the feedback + cheers;
rsn

Attachment: pgpaG0Qoq4mQR.pgp
Description: PGP signature

Reply via email to