Re: [CLI] [DISCUSS] Help formatter extension proposal

2024-11-12 Thread Claude Warren
Width is set in the TextStyle and (potentially) in the Appendable. The TextStyle specifies for the specific chunk of code what the requested size is. The Appendable can ignore that or make adjustments to it. This is seen in the TextHelpAppendable.appendTable() method where the specified columns

Re: [CLI] [DISCUSS] Help formatter extension proposal

2024-11-12 Thread Gary Gregory
Hi Eric, TextStyle and TextHelpAppenndable carry widths. HTH, Gary On Tue, Nov 12, 2024, 7:43 AM Eric Pugh wrote: > Working through it… I am hoping to be able to contribute a > AsciiDocAppendable. > > So, here is a question.. How do I set the Width? > HelpFormatter.setWidth() has gone a

Re: [CLI] [DISCUSS] Help formatter extension proposal

2024-11-12 Thread Eric Pugh
Working through it… I am hoping to be able to contribute a AsciiDocAppendable. So, here is a question.. How do I set the Width? HelpFormatter.setWidth() has gone away, and I can’t quite track where it went! > On Nov 10, 2024, at 10:36 AM, Gary Gregory wrote: > > Let me know and feel f

Re: [CLI] [DISCUSS] Help formatter extension proposal

2024-11-10 Thread Gary Gregory
Let me know and feel free to create a PR. I can cut a release candidate whenever you are ready. Gary On Sun, Nov 10, 2024, 7:23 AM Eric Pugh wrote: > I am starting to poke at the CLI-339 feature.. Looking at the PR, > > https://github.com/apache/commons-cli/pull/314/files#diff-c5837d81e3e4f87

Re: [CLI] [DISCUSS] Help formatter extension proposal

2024-11-10 Thread Eric Pugh
I am starting to poke at the CLI-339 feature.. Looking at the PR, https://github.com/apache/commons-cli/pull/314/files#diff-c5837d81e3e4f87d5222b1d8caa45c9c9cd2c6edff6ad31e3a0b603f0b64d389, I see the code...I am not quite seeing the big picture however... I am hoping to see some docs on "How

Re: [CLI] [DISCUSS] Help formatter extension proposal

2024-10-04 Thread Claude Warren
Thx Gary. I will review this weekend. On Fri 4 Oct 2024, 15:41 Gary D. Gregory, wrote: > Hi all, > > I wrote a bunch of comments in the PR. > > Gary > > On 2024/10/02 10:57:53 Tushar Kapila wrote: > > I don't contribute code. But looking at the dictionary meaning Scribe > fits. > > So my vote i

Re: [CLI] [DISCUSS] Help formatter extension proposal

2024-10-04 Thread Gary D. Gregory
Hi all, I wrote a bunch of comments in the PR. Gary On 2024/10/02 10:57:53 Tushar Kapila wrote: > I don't contribute code. But looking at the dictionary meaning Scribe fits. > So my vote is Scribe. > > a word that fits and not confused with existing class/ responsibility? > > verb > 1. > liter

Re: [CLI] [DISCUSS] Help formatter extension proposal

2024-10-02 Thread Tushar Kapila
I don't contribute code. But looking at the dictionary meaning Scribe fits. So my vote is Scribe. a word that fits and not confused with existing class/ responsibility? verb 1. literary write. "he scribed a note that he passed to Dan" On Wed, 2 Oct 2024, 14:35 Gary Gregory, wrote: > Sorry abou

Re: [CLI] [DISCUSS] Help formatter extension proposal

2024-10-02 Thread Gary Gregory
Sorry about that, I'll have a look today or tomorrow. Gary On Wed, Oct 2, 2024, 3:39 AM Claude Warren wrote: > Not hearing any other ideas and even though I prefer "Scribe" I will rename > the class to "HelpWriter". > > Thanks everyone for your input. > > On Mon, Sep 30, 2024 at 9:26 PM Peter B

Re: [CLI] [DISCUSS] Help formatter extension proposal

2024-10-02 Thread Claude Warren
Not hearing any other ideas and even though I prefer "Scribe" I will rename the class to "HelpWriter". Thanks everyone for your input. On Mon, Sep 30, 2024 at 9:26 PM Peter Burka wrote: > My vote (which everyone is free to ignore) is still for HelpWriter. It's > simple and intuitive, and it's c

Re: [CLI] [DISCUSS] Help formatter extension proposal

2024-09-30 Thread Peter Burka
My vote (which everyone is free to ignore) is still for HelpWriter. It's simple and intuitive, and it's consistent with the names of the methods the interface declares (e.g. writePara, writeTable). I find SemanticAppendableDecorator too verbose and I have no intuition for what it means. Peter On

Re: [CLI] [DISCUSS] Help formatter extension proposal

2024-09-30 Thread Claude Warren
If we can settle on a name for the serializer/scribe/writer/printDecorator/amenuensis thing the rest of the code is ready. It passes all the tests, it has 100% test coverage, and it works for what Rat is trying to do. On Sat, Sep 28, 2024 at 2:08 PM Claude Warren wrote: > I have opened https:

Re: [CLI] [DISCUSS] Help formatter extension proposal

2024-09-28 Thread Claude Warren
I have opened https://github.com/apache/commons-cli/pull/314 to track the proposed changes On Sat, Sep 28, 2024 at 11:42 AM Claude Warren wrote: > I know some graphics programs use the term "engraver" for code that > creates the output of graphical representations of things (like notes, > staves

Re: [CLI] [DISCUSS] Help formatter extension proposal

2024-09-28 Thread Claude Warren
I know some graphics programs use the term "engraver" for code that creates the output of graphical representations of things (like notes, staves, and resets in musical notation). Scribe seems like the textual equivalent. If we go with the decorator approach then I think the underlying interface

Re: [CLI] [DISCUSS] Help formatter extension proposal

2024-09-28 Thread Gilles Sadowski
Le sam. 28 sept. 2024 à 00:17, Gary Gregory a écrit : > > It's pretty unusual IMO, not like anything in the JDK for example. Agreed. > I'll see > if I can come up with something tomorrow... How about "PrintDecorator" ? Gilles >>> [...]

Re: [CLI] [DISCUSS] Help formatter extension proposal

2024-09-27 Thread Gary Gregory
It's pretty unusual IMO, not like anything in the JDK for example. I'll see if I can come up with something tomorrow... Gary On Fri, Sep 27, 2024, 6:11 PM Claude Warren wrote: > Anybody have an objection to using Scribe as the class name? > > On Thu, Sep 26, 2024 at 11:25 AM Claude Warren wrot

Re: [CLI] [DISCUSS] Help formatter extension proposal

2024-09-27 Thread Claude Warren
Anybody have an objection to using Scribe as the class name? On Thu, Sep 26, 2024 at 11:25 AM Claude Warren wrote: > I am now thinking "Scribe". Writer tend to indicate that you can do low > level writing and would expect the Writer to implement the Writer interface. > > "Amanuensis" comes to m

Re: [CLI] [DISCUSS] Help formatter extension proposal

2024-09-26 Thread Claude Warren
I am now thinking "Scribe". Writer tend to indicate that you can do low level writing and would expect the Writer to implement the Writer interface. "Amanuensis" comes to mind but that is too hard to spell/type. ;) Claude On Thu, Sep 26, 2024 at 4:26 AM Peter Burka wrote: > That sounds simi

Re: [CLI] [DISCUSS] Help formatter extension proposal

2024-09-25 Thread Peter Burka
That sounds similar to java.io.Writer. Maybe this should be a HelpWriter? On Wed, Sep 25, 2024, 7:11 PM Claude Warren wrote: > Actually the Producer constructor takes an "Appendable" as an argument and > then provides methods like > > printPara("Some text here") > > Which would output a paragrap

Re: [CLI] [DISCUSS] Help formatter extension proposal

2024-09-25 Thread Claude Warren
Actually the Producer constructor takes an "Appendable" as an argument and then provides methods like printPara("Some text here") Which would output a paragraph of "Some text here" TestProducer appends "Some text here\n\n" (where \n is System.lineSeparator) to the appendable XmlProducer would ap

Re: [CLI] [DISCUSS] Help formatter extension proposal

2024-09-25 Thread Gary Gregory
On Wed, Sep 25, 2024 at 6:09 PM Claude Warren wrote: > > I have to agree that Serializer is an overloaded term and should be > avoided, and I knew when I named it that the name would have to change. > But I don't like "Render" because it is a verb and the noun for something > that renders would be

Re: [CLI] [DISCUSS] Help formatter extension proposal

2024-09-25 Thread Claude Warren
I have to agree that Serializer is an overloaded term and should be avoided, and I knew when I named it that the name would have to change. But I don't like "Render" because it is a verb and the noun for something that renders would be a renderer. And to my ears (and fingers) that seems clunky. H

Re: [CLI] [DISCUSS] Help formatter extension proposal

2024-09-25 Thread Gary Gregory
Quick comment: I don't think we should call anything "seriialize*", it's too close to Java serialization. I'd use "render". Gary On Wed, Sep 25, 2024 at 7:11 AM Claude Warren wrote: > > Some initial code. Note the "help" package name. We can discuss keeping > it or not but it is here to make i

Re: [CLI] [DISCUSS] Help formatter extension proposal

2024-09-25 Thread Claude Warren
Some initial code. Note the "help" package name. We can discuss keeping it or not but it is here to make it easy to see what is new. Also, some methods added to Util.java https://github.com/Claudenw/commons-cli/tree/Help_formatter_extension/src/main/java/org/apache/commons/cli/help Overview be

Re: [CLI] [DISCUSS] Help formatter extension proposal

2024-09-23 Thread Eric Pugh
Keep us posted! I would love to contribute a Markdown format. > On Sep 23, 2024, at 7:20 AM, Claude Warren wrote: > > I have a system that mostly works. But implementing XML output requires > StringEscapeUtils from commons-text. I know we are reluctant to include > other packages. So my tho

Re: [CLI] [DISCUSS] Help formatter extension proposal

2024-09-23 Thread Claude Warren
I have a system that mostly works. But implementing XML output requires StringEscapeUtils from commons-text. I know we are reluctant to include other packages. So my thought is that we provide the XML option as an example so that we don't include the commons-text in the package. My strategy is

Re: [CLI] [DISCUSS] Help formatter extension proposal

2024-09-20 Thread Gary Gregory
Looking forward to it 😀 Gary On Fri, Sep 20, 2024, 3:56 AM Claude Warren wrote: > I have been working on Rat and have a set of classes that output markdown. > I think I can make CLI HelpFormtter system take a class to output the data > in any given format. > > What rat is doing now is writing h

Re: [CLI] [DISCUSS] Help formatter extension proposal

2024-09-20 Thread Claude Warren
I have been working on Rat and have a set of classes that output markdown. I think I can make CLI HelpFormtter system take a class to output the data in any given format. What rat is doing now is writing help to a file and using APT format to include that using Velocity. Gary's point that XML pro

Re: [CLI] [DISCUSS] Help formatter extension proposal

2024-09-19 Thread Eric Pugh
I would love to see the ability to output the help docs in a format that could be dropped into documentation. In Solr we basically cut and paste the -h output into the Reference Guide, it works but it’s ugly and manual. I’ve been experimenting with some tools that let you run a tool, capture

Re: [CLI] [DISCUSS] Help formatter extension proposal

2024-09-19 Thread Gary Gregory
Hi Claude, I think it needs to be flexible/complex just enough to support doing what I mentioned. I like XML because once you have that, you can get anywhere else with XSL. How do you do transformations in JSON anyway? Has that wheel been reinvented? JOLT seems not to have gone anywhere. Maybe we

Re: [CLI] [DISCUSS] Help formatter extension proposal

2024-09-19 Thread Claude Warren
This could get complex fairly quickly. So a couple of questions: Q: Do we want to create a new commons project or perhaps expand commons-text to contain a simple library for formatting output. If we do that we would have to include it in commons-cli which I know is undesirable, but if text is sm

Re: [CLI] [DISCUSS] Help formatter extension proposal

2024-09-18 Thread Gary Gregory
If we create something new, it would be nice to have example in tests that show rendering to XHTML and XML. This means the abstract superclass should not assume console output. A site can use its own CSS for styling. If we are flexible enough we should not need to create yet another thing in the fu

Re: [CLI] [DISCUSS] Help formatter extension proposal

2024-09-18 Thread Claude Warren
I think that help formatting really comes down to building a textual matrix from a list of Options. To do this we need to have several things: 1. A list of headers (text for the columns in the table) 2. The minimum and maximum width for each column. (perhaps as a % of the width) 3. A m

Re: [CLI] [DISCUSS] Help formatter extension proposal

2024-09-18 Thread Gary Gregory
Or a new better formatting class? Gary On Wed, Sep 18, 2024, 9:45 AM Claude Warren wrote: > After more exploration it seems that HelpFormatter is really not designed > to be extended. I will have to rethink this. It may make sense to make > some of the HelpFormatter methods static so that the

Re: [CLI] [DISCUSS] Help formatter extension proposal

2024-09-18 Thread Claude Warren
After more exploration it seems that HelpFormatter is really not designed to be extended. I will have to rethink this. It may make sense to make some of the HelpFormatter methods static so that they can be used in other implementations. On Wed, Sep 18, 2024 at 9:29 AM Claude Warren wrote: > Gr

[CLI] [DISCUSS] Help formatter extension proposal

2024-09-18 Thread Claude Warren
Greetings, I have a case in RAT where we want to append a line to the help text when the option has multiple arguments or when we have defined a default value. I have implemented this in a renderOptions() implementation in CLI 1.8.0. In both cases we use the Option to check for some state and the