You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2006/02/10 16:27:57 UTC

DO NOT REPLY [Bug 38609] New: - [cli][PATCH] HelpWriter.printWrapped() should have public access

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38609>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38609

           Summary: [cli][PATCH] HelpWriter.printWrapped() should have
                    public access
           Product: Commons
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: CLI
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: sjr@jdns.org


Hi there,

I think HelpWriter.printWrapped() is a neat utility function for outputting any
wrapped text. Adding a flush() statement makes it a tidy general purpose utility.

Patch attached. I found it useful anyway!

Thanks!

Regards,
James

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


DO NOT REPLY [Bug 38609] - [cli][PATCH] HelpWriter.printWrapped() should have public access

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38609>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38609





------- Additional Comments From bayard@apache.org  2006-03-08 07:18 -------
+1 to Martin's suggestion.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


DO NOT REPLY [Bug 38609] - [cli][PATCH] HelpWriter.printWrapped() should have public access

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38609>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38609





------- Additional Comments From mvdb@apache.org  2006-02-11 00:41 -------
"I think all the public print() methods should have a call to flush() at the end."

If you can reflect that in your patch (with mention of it in the javadoc that it
flushes on print, something like "All public print methods flush on exit".

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


DO NOT REPLY [Bug 38609] - [cli][PATCH] HelpWriter.printWrapped() should have public access

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38609>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38609





------- Additional Comments From sjr@jdns.org  2006-02-10 16:29 -------
Created an attachment (id=17642)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=17642&action=view)
Patch to implement minor enhancement


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


DO NOT REPLY [Bug 38609] - [cli][PATCH] HelpWriter.printWrapped() should have public access

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38609>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38609





------- Additional Comments From mvdb@apache.org  2006-02-10 23:17 -------
What is the benefit for CLI of this patch ?
Based on the current flush() usage in HelpFormatter (only once at the end), it
also behaves differently from the rest of the write methods.
getOut().flush() gives you the same result.
(I assume you call printWrapped yourself from somewhere..)


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


DO NOT REPLY [Bug 38609] - [cli][PATCH] HelpWriter.printWrapped() should have public access

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38609>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38609





------- Additional Comments From sjr@jdns.org  2006-02-10 23:58 -------
Hi there,

(In reply to comment #2)
> What is the benefit for CLI of this patch ?

It increases the utility of the HelpFormatter class. I used it to
unconditionally print some GPL "NO WARRANTY" boilerplate in a nice wrapped
format, even if I don't go on to call other print...() methods.

> Based on the current flush() usage in HelpFormatter (only once at the end), it
> also behaves differently from the rest of the write methods.

flush() is called only once at the end of the print() method. There are other
useful public methods, such as printHelp() and printUsage() which don't have
flush() called at the end. Additionally, there is no API documentation to
indicate to the caller that this is the case. So, right now, the API doesn't
behave as the caller would expect.

I think all the public print() methods should have a call to flush() at the end.
It won't add any great overhead to what will never be a fast code path anyway.

> getOut().flush() gives you the same result.
> (I assume you call printWrapped yourself from somewhere..)
> 

That's right, but I have to know when to call it. The API documentation doesn't
help me with that, and there are other nice inviting public methods for which
the same problem applies.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org