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

Indent help text #1019

Merged
merged 1 commit into from
Apr 2, 2017
Merged

Indent help text #1019

merged 1 commit into from
Apr 2, 2017

Conversation

babbageclunk
Copy link
Contributor

Add a DISCUSSION heading to each item and indent (and rewrap) the help text.

Fixes #940.

@brson
Copy link
Contributor

brson commented Mar 31, 2017

Thanks @babbageclunk!

@kbknapp I wonder if you can peek at this and suggest whether it's the right way. My understanding of this issue is that we are trying to imitate claps generated formatting manually. Can clap itself produce formatting like this for these freeform text bits.

@kbknapp
Copy link
Contributor

kbknapp commented Mar 31, 2017

@brson Unfortunately this is the best way at this time.

The after_help portion is designed to be free-form and thus all headers and formatting are left to users. The only thing that after_help does do is rewrap properly at word boundaries. But since rustup is already using hard newline wrapping this isn't really an issue.

With the current PR, if someone has a terminal window with < 70 (I think?) columns the rewrapping that clap will do won't respect the hard tabs (or 4x spaces). However, someone with a terminal window that small is probably a rare-ish occurrence.

I'm open to someone adding the ability for clap to respect the starting indentation when using templates, and would be willing to mentor such efforts. I just don't have time to implement it myself at the moment. This would be the best solution as then all rewrapping and indentation is handled by clap.

@Diggsey
Copy link
Contributor

Diggsey commented Apr 1, 2017

Let's do this for now, we can always improve it later if we find a better way.

@bors r+

@bors
Copy link
Contributor

bors commented Apr 1, 2017

📌 Commit 086143e has been approved by Diggsey

@bors
Copy link
Contributor

bors commented Apr 2, 2017

⌛ Testing commit 086143e with merge 9ac68e9...

bors added a commit that referenced this pull request Apr 2, 2017
Indent help text

Add a DISCUSSION heading to each item and indent (and rewrap) the help text.

Fixes #940.
@bors
Copy link
Contributor

bors commented Apr 2, 2017

💔 Test failed - status-travis

@Diggsey Diggsey merged commit b379f7f into rust-lang:master Apr 2, 2017
@babbageclunk
Copy link
Contributor Author

babbageclunk commented Apr 2, 2017 via email

@Diggsey
Copy link
Contributor

Diggsey commented Apr 2, 2017

Just a network error, yeah.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants