Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help text should automatically wrap based on term width #287

Closed
nikkolasg opened this issue Oct 20, 2015 · 21 comments
Closed

Help text should automatically wrap based on term width #287

nikkolasg opened this issue Oct 20, 2015 · 21 comments
Labels
area/v2 relates to / is being considered for v2 help wanted please help if you can! kind/feature describes a code enhancement / feature request status/confirmed confirmed to be valid, but work has yet to start
Milestone

Comments

@nikkolasg
Copy link
Contributor

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.

@cvle
Copy link

cvle commented Nov 13, 2015

+1

1 similar comment
@syossan27
Copy link

+1

@meatballhat meatballhat added the kind/feature describes a code enhancement / feature request label May 17, 2016
@meatballhat meatballhat changed the title Feature request: Autoformatting help text Help text should automatically wrap based on term width May 17, 2016
@immesys
Copy link

immesys commented Sep 5, 2016

+1

@hickeng
Copy link

hickeng commented Oct 10, 2016

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

@JensRantil
Copy link

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

@coilysiren coilysiren added help wanted please help if you can! status/confirmed confirmed to be valid, but work has yet to start labels Aug 17, 2019
@coilysiren coilysiren added status/in-review needs to be reviewed by maintainers before it is accepted and removed help wanted please help if you can! status/confirmed confirmed to be valid, but work has yet to start labels Sep 10, 2019
@coilysiren
Copy link
Member

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 coilysiren added the area/v2 relates to / is being considered for v2 label Nov 27, 2019
@saschagrunert
Copy link
Member

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

@coilysiren coilysiren added help wanted please help if you can! status/confirmed confirmed to be valid, but work has yet to start and removed status/in-review needs to be reviewed by maintainers before it is accepted labels Jan 16, 2020
@coilysiren
Copy link
Member

👀 this is now ready for anyone to work on!

@xordspar0
Copy link
Contributor

...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.

@mostynb
Copy link
Contributor

mostynb commented May 6, 2020

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

@stale
Copy link

stale bot commented Aug 4, 2020

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 stale bot added the status/stale stale due to the age of it's last update label Aug 4, 2020
@mostynb
Copy link
Contributor

mostynb commented Aug 4, 2020

Bump.

@stale
Copy link

stale bot commented Aug 4, 2020

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 stale bot removed the status/stale stale due to the age of it's last update label Aug 4, 2020
@stale
Copy link

stale bot commented Nov 3, 2020

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 stale bot added the status/stale stale due to the age of it's last update label Nov 3, 2020
@mostynb
Copy link
Contributor

mostynb commented Nov 3, 2020

Bump.

@stale
Copy link

stale bot commented Nov 3, 2020

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 stale bot removed the status/stale stale due to the age of it's last update label Nov 3, 2020
@stale
Copy link

stale bot commented Feb 2, 2021

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 stale bot added the status/stale stale due to the age of it's last update label Feb 2, 2021
@mostynb
Copy link
Contributor

mostynb commented Feb 2, 2021

Bump.

@stale
Copy link

stale bot commented Feb 2, 2021

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 stale bot removed the status/stale stale due to the age of it's last update label Feb 2, 2021
@dearchap
Copy link
Contributor

Duplicate of #674

@dearchap dearchap marked this as a duplicate of #674 Oct 21, 2022
@dearchap dearchap closed this as not planned Won't fix, can't repro, duplicate, stale Oct 21, 2022
@mostynb
Copy link
Contributor

mostynb commented Oct 21, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/v2 relates to / is being considered for v2 help wanted please help if you can! kind/feature describes a code enhancement / feature request status/confirmed confirmed to be valid, but work has yet to start
Projects
None yet
Development

No branches or pull requests