-
Notifications
You must be signed in to change notification settings - Fork 256
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
Option -h doesn't respect comment newlines. #358
Comments
I see two problems here, and one of them is definitely a mage bug. Mage scrapes the go doc for the function. If you run So if you do this,
(note there are two spaces before each dash) However, even doing that does not produce good output with mage. This will take a little looking into. I think we had stripped out line returns on the assumption that the terminal would wrap it for you.... but that's not the right thing to do for preformatted stuff like this. If go doc writes the right thing (which it seems to), we might be able to just steal that text directly. |
Wouldn't this be solved by just removing the following call to Line 250 in 02bde0b
Is this something else that I'm missing on why that's needed @natefinch? It makes sense to convert comments into one-liners for targets help messages, but not for the package comment. Edit: I've opened a PR #459 that resolves this issue with the approach described above. |
Hmm. I had problems with keeping the original newlines, because the width of your editor window might be wider than your terminal window... And while the editor will scroll off the right side with a horizontal scrollbar, the terminal just wraps it and makes it super ugly. It's not great. It would definitely be better to have some middle ground that could preserve lone returns without messing up all the formatting from ugly line wraps. |
Formatting in the terminal is always a tricky problem, but I think that whatever Ugly terminal wraps in widths smaller than 80 characters sucks, but the current behaviour of mixing everything in just one line it's worse, specially with current decade wide & ultra-wide high-res monitors. |
Given the following target (imported into main magefile):
The following is the output of -h:
Expected behavior would be to print the comments with their newlines as written in the comments describing the imported target, like so:
The text was updated successfully, but these errors were encountered: