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

Newlines in OptionParser option descriptions should be indented #10183

Merged
merged 1 commit into from
Jan 6, 2021

Conversation

wonderix
Copy link
Contributor

@wonderix wonderix commented Jan 3, 2021

Fixes #5832

@@ -278,8 +278,10 @@ class OptionParser
end

private def append_flag(flag, description)
indent = " " * 37
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pretty sure that fixed number won't work well with flags that are less than 33 characters long.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This indent is only used for the description or in case flags are longer than 33 characters.
In the test spec both cases are tested (flags.size < 33 and flags.size > 33).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I was mistaken about how the indent works for flag.size < 33.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it used in the following line (before the if flag.size >= 33)?

@asterite asterite added this to the 1.0.0 milestone Jan 6, 2021
@asterite
Copy link
Member

asterite commented Jan 6, 2021

I changed the description from "relates" to "fixes" so the linked issue is automatically closed

@asterite asterite merged commit 5fde64b into crystal-lang:master Jan 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Newlines in OptionParser option descriptions should be indented
4 participants