-
Notifications
You must be signed in to change notification settings - Fork 272
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
Don't format options table like errors #1306
Conversation
Printing this to stderr seems correct, since it is printed when there has been a failure. The resolution of #1175 was that we wanted to avoid using more than one stream in most cases to avoid synchronization problems in tools that log the streams separately. |
This doesn't change with this PR. However, the options table is also used for the help command in which case the rest of the output goes to stdout. This is what this PR fixes. |
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.
This LGTM with a few end to end tests added:
vcpkg help
output going tostdout
vcpkg help not-a-topic
output going tostderr
vcpkg not-a-command
output going tostderr
vcpkg install --not-a-switch
output going tostderr
Good point! |
I want to emphasise that in all 3 error cases all of the output went to
I don't have any experiences with PowerShell or how the end to end tests work. |
I added them |
Thanks :) |
The output of
vcpkg help <command>
was formatted like an error message.To fix this, I renamed
print_usage
tousage_for_command
and made it return aLocalizedString
instead of printing as an error message right away. This allows a more flexible use of this function.I also changed consumers to print this to stdout in order to be consistent with surrounding messages