cli icon indicating copy to clipboard operation
cli copied to clipboard

Help text should automatically wrap based on term width

Open nikkolasg opened this issue 10 years ago • 19 comments

When we got a long text description in Usage, it should automatically wrap and make a nice display. A bit like what "man" does, it automatically rewraps the text so it fits nicely in the current terminal session.

nikkolasg avatar Oct 20 '15 09:10 nikkolasg

+1

cvle avatar Nov 13 '15 17:11 cvle

+1

syossan27 avatar Jan 06 '16 12:01 syossan27

+1

immesys avatar Sep 05 '16 21:09 immesys

and should be able to handle \n in the various command and flag descriptions, indenting appropriately.

hickeng avatar Oct 10 '16 15:10 hickeng

...or simply wrap at 80 characters, which is considered a common default and also adheres to general readability best-practises.

JensRantil avatar Aug 07 '17 06:08 JensRantil

This feature is now in review - @urfave/cli please add a 👍 or 👎 to the top post if you're in favor or against this feature being added!

coilysiren avatar Sep 10 '19 06:09 coilysiren

@lynncyrin we should move forward with this one. Wrapping based on the term width seems a sane default. :)

saschagrunert avatar Jan 16 '20 14:01 saschagrunert

👀 this is now ready for anyone to work on!

coilysiren avatar Jan 16 '20 21:01 coilysiren

...or simply wrap at 80 characters, which is considered a common default and also adheres to general readability best-practises.

I agree that an 80 character limit would be easier to read. It would also be easier to implement. That said, I don't want to bikeshed this issue. Whoever actually does the work to implement this will have my vote.

xordspar0 avatar Mar 08 '20 23:03 xordspar0

I will try to make #1119 implement a basic version of this feature.

mostynb avatar May 06 '20 06:05 mostynb

This issue or PR has been automatically marked as stale because it has not had recent activity. Please add a comment bumping this if you're still interested in it's resolution! Thanks for your help, please let us know if you need anything else.

stale[bot] avatar Aug 04 '20 08:08 stale[bot]

Bump.

mostynb avatar Aug 04 '20 08:08 mostynb

This issue or PR has been bumped and is no longer marked as stale! Feel free to bump it again in the future, if it's still relevant.

stale[bot] avatar Aug 04 '20 08:08 stale[bot]

This issue or PR has been automatically marked as stale because it has not had recent activity. Please add a comment bumping this if you're still interested in it's resolution! Thanks for your help, please let us know if you need anything else.

stale[bot] avatar Nov 03 '20 03:11 stale[bot]

Bump.

mostynb avatar Nov 03 '20 06:11 mostynb

This issue or PR has been bumped and is no longer marked as stale! Feel free to bump it again in the future, if it's still relevant.

stale[bot] avatar Nov 03 '20 06:11 stale[bot]

This issue or PR has been automatically marked as stale because it has not had recent activity. Please add a comment bumping this if you're still interested in it's resolution! Thanks for your help, please let us know if you need anything else.

stale[bot] avatar Feb 02 '21 03:02 stale[bot]

Bump.

mostynb avatar Feb 02 '21 08:02 mostynb

This issue or PR has been bumped and is no longer marked as stale! Feel free to bump it again in the future, if it's still relevant.

stale[bot] avatar Feb 02 '21 08:02 stale[bot]

Duplicate of #674

dearchap avatar Oct 21 '22 18:10 dearchap

I added line-wrapping support in #287, but the terminal's width detection is not automatic (to avoid adding new dependencies/adding binary size). Here's an example of how client code can specify the line-wrap length: https://github.com/urfave/cli/pull/1119/files#diff-4d3f36d62cad94424544bb84fc93b33b73ffe3491a4ddca81a7f825539afc19cR1161-R1169

mostynb avatar Oct 21 '22 18:10 mostynb