-
Notifications
You must be signed in to change notification settings - Fork 293
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
Added the ability to use \n and/or \r in HelpText #169
base: master
Are you sure you want to change the base?
Conversation
I've added comments to the PR #168 that you closed... This is the new version of the PR? |
Yes this is a new version, I apologize for the confusion and I will add a test |
@rupe120, no problem... 👍 If you need to ask something, don't hesitate. |
Thanks! Will do On Tue, Jun 23, 2015 at 9:16 AM, Giacomo Stelluti Scala <
|
So it's OK, I wait you test addition and if possible (and you've a time) a sample (side by side) of current help output and what you want to get. Have a nice day! |
Np, the sample should be fairly easy On Tue, Jun 23, 2015 at 2:15 PM, Giacomo Stelluti Scala <
|
Hey guys, heads up on xunit. They've changed their runner and switched from an extension to a NuGet package http://xunit.github.io/docs/running-tests-in-vs.html |
btw, I actually removed \r from the processing because I thought it would be confusing to see \r\n and actually receive 2 lines. While I did want \n\n to give you 2 lines, the distinction would be more logic then I felt necessary. So I just eliminated the \r |
Would using |
@indigotock, yes, is also consistent with the rest of (If you've done in it, please forgive me, have you verified if after the change all tests are green?) Ping me when you're done, I'll fetch the PR locally to proceed. |
Ok so, I agree that we need to keep everything consistent. On the other hand, I'm seeing this context as being different from the other places where If I use the Thoughts? |
With that said, I agree that there should be a comment next to the |
I think that users implementing new lines "incorrectly" is something which shouldn't be counted on by the library? Quite interested to hear other peoples' opinions on this. Perhaps there could be an enum flag which allows the author to specify the new line sequence? Something like enum NewLineStyle{
LineFeed,
CarriageReturnLineFeed,
EnvironmentNewLine,
Any
} Although this feel a little bit over-engineered |
Though to do this "correctly" would make for more awkward HelpText creation, either using |
I think it's more developer friendly to view attribute property text as a version of formatted text, to minimize the logic they need to surround the string with |
But that's just me :o) |
Usually when I tackle the issue of platform dependent new line characters I choose one to use internally, usually \n, then everywhere input is read and Environment.NewLine is not equal to \n I coerce. And in the same way everywhere output is written to Console I also coerce. Here we have a bit of a corner case because a user of the library would supply text with newlines that shouldn't (imo) be coerced and has to know to stick to \n or whatever internal representation we decide upon. @rupe120 Please edit your existing post if you feel you need to amend something, you created 3 posts in 6 minutes. |
It's just occurred to me that C# can split strings with arrays of strings, not just chars (not sure on the performance of this): Split(new string[] { "\r\n", "\n", Environment.NewLine }, StringSplitOptions.Whatever? ) Failing that, one could replace all occurances of |
@mizipzor My apologies for the comment spam. Will do. @indigotock I can do that, and I think that might actually lead to more expected and intuitive behavior. In addition, I also believe the array argument is the default operation of split so it should be just as performant, that and we aren't really dealing with massive amounts of text here. I vote for @indigotock's string array suggestion |
An issue with that is I'm now sure how it will handle splitting on |
@@ -7,4 +7,5 @@ | |||
<package id="xunit.core" version="2.0.0" targetFramework="net45" /> | |||
<package id="xunit.extensibility.core" version="2.0.0" targetFramework="net45" /> | |||
<package id="xunit.extensions" version="2.0.0" targetFramework="net45" /> | |||
<package id="xunit.runner.visualstudio" version="2.0.0" targetFramework="net45" /> |
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.
I ran across this problem as well needing to add the xunit.runner dependency. Can we get this as a separate pull request (I can do it)? I would like this merged right away, separate from this discussion.
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.
Ya, that was part of my comments above. I thought you might want to do that.
@mizipzor Should I negate that from my branch to remove it from this pull request when my tests are complete?
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.
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.
That's works for me. That just means I don't need to do anything :o)
I'll test it, but I believe if you have |
Spotted another issue, assuming we are trying to get this merged, the file |
Let me know how that works. Also note that I added a .gitignore line to exclude *.DotSettings.user |
While you added an ignore for the file the file itself is still commited. :) |
Ya, it was to metaphorically stop the bleeding. How do you remove a file from a repo? Is the only way to:
|
Yes, that is the simple and obvious way to do it. Though this is a good opportunity to learn some advanced Github. If you want, here's what I would do. Note that all this happens locally, everything currently online serves as a backup, so go nuts. Edit: It's important to have the branch you want to rebase checked out:
You now get a document in your default text editor. Here's how my look (I fetched your branch):
We want to change this into the following:
Note the word In the console now you should see that Git is waiting for you to edit the relevant commit. Open the folder and delete the
Git will now complain about a commit being empty since we've changed stuff around. Do:
That should be it. 😃 At this point look over your commits. Up until now all has been locally, until you push this everything online serves as a backup. To force push this replacing the current commits in the branch:
Here's some extra documentation if you like reading. As an example and making sure it works I did this locally and pushed as a branch on my fork. An interesting tidbit here that I like is that we are both listed on the commit, you're the author and I'm commiter, since I've changed it. Even if I would do cleanup, you still get credit. You now know more Git. Gratz. |
@mizipzor, this is useful to me too! 👍 |
@mizipzor These are some awesome Git ninja moves! I think I'm going to need to read through a couple times to really get my head around it. Thank you so much! |
Updated the comment with a step (the checkout) that I didn't include initially. Another reminder also that if you screw up something while doing this the branch is still online so can just nuke your local clone and re-download your fork. And @gsscoder, if you want to try this you don't have to wait for a an opportunity, you can do what I did which is do pull this branch specifically and do the rebase cleanup. |
@mizipzor, just one thing... I was unable to understand the word nuke when you say:
Can you give me a synonymous? Thanks. |
Sure. Nuke as in delete the repository folder from your hard drive and start over, like it never was there. Doing the whole |
@mizipzor, OK, now it's clear. |
It would be helpful to be able to create more than one paragraph in the HelpText, for the instances where there is supplemental / conditional information to add.
I have a scenario where depending on the list of options supplied, a given option may have slightly different behavior and/or be required or not.
It tends to be helpful if the user can see clear separation between the default functionality of an option, and additional scenarios.