You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I inadvertently created an argument description that turned out to be 37 characters long. When help is displayed, the description displays as follows:
--lts, -l Download 'Long Term Support' releases[boolean] [default: false]
Personally I think it would look better if the line had a line break inserted via the _renderInLine function in order to keep the description from running into the square bracket. If the description is 38 characters in length, it will render the type and default on a separate line.
A simple change to the _renderInLine function in index.ts, changing this code:
if (leadingWhitespace < targetTextWidth) {
to this:
if (leadingWhitespace < targetTextWidth + 1) {
allows the line to break if the description is the maximum width of the field.
The text was updated successfully, but these errors were encountered:
I did try several ideas before focusing on cliui. Within my own module, I tried adding whitespace to the end of the description but that is trimmed off by cliui. In the help function of usage.js, I converted the "desc" argument of ui.span to an object and adding padding and width properties:
That worked in a sense as the description field had a break inserted in the line and wrapped to a new line. But that behavior is different from when the description is longer than 37 characters and the argument type and default are themselves on a separate line. However, the description field has a set width of 37 somewhere in the code that I did not seek out. Of course it could be increased to 38 but then a description field of 38 would exhibit the same problem then.
I inadvertently created an argument description that turned out to be 37 characters long. When help is displayed, the description displays as follows:
--lts, -l Download 'Long Term Support' releases[boolean] [default: false]
Personally I think it would look better if the line had a line break inserted via the _renderInLine function in order to keep the description from running into the square bracket. If the description is 38 characters in length, it will render the type and default on a separate line.
A simple change to the _renderInLine function in index.ts, changing this code:
if (leadingWhitespace < targetTextWidth) {
to this:
if (leadingWhitespace < targetTextWidth + 1) {
allows the line to break if the description is the maximum width of the field.
The text was updated successfully, but these errors were encountered: