-
Notifications
You must be signed in to change notification settings - Fork 482
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
Improve spacing in HelpText #494
Improve spacing in HelpText #494
Conversation
Usage only
Error only
Error and Usage
Usage and pre-options
Error and pre-options
Usage, Error, and pre-options
|
Thanks @asherber for your work.
|
This PR includes changes to the unit tests so that they pass with the new output. I also don't think this should be hidden behind an option flag, because it corrects the current undesirable spacing -- all users should get the new behavior without having to opt in to it. |
Or are you talking about not breaking test cases for consumers of the library? I can see that point. What do you think about the space before PreOptions? If it was intentional not to have a space between the header and PreOptions, then I'll take that out and add the flag as you suggest. But for the PR as currently written (including space before PreOptions), then the flag should probably be something like What do you think? |
It may be something like:
That handle all newlines you added including: PreOptions, Usage, ... |
Sorry this took me a while to get to -- I was on vacation. I hope this looks good to you now. |
Thanks for the change. |
Moving that code into its own methods makes the code in |
I guess it's used to check for existing Environment.NewLine. Is it? |
Ah, you're right, I meant to do that and forgot. I'll add it this evening. |
Really glad someone made a PR for this! Was the first thing that bothered me when I first started looking at this library 2 hours ago. :) Let's get it merged! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
Approved
I'd like to use the improvement being referenced here, is there a way for me to integrate this development branch improvement into my project through NuGet? |
Resolves #491
The goal was to make vertical spacing consistent between sections. In
HelpText.ToString()
, things got slightly complicated because it occurred to me that some users might already be starting PreOptions with their own newline, so I didn't want to add another.I added a test and also changed some existing tests to look at spacing (using
ToLines()
instead ofToNotEmptyLines()
).Some example help screens, showing before and after, are in the following comment.
Edit: (If it's intentional/desirable for PreOptions to start right after the copyright, with no space, then I can amend this PR to take that bit out. But I still think there should be a space before Usage.)