-
Notifications
You must be signed in to change notification settings - Fork 32
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
Allow RedirectStandardErrorTo StandardOutput #14
Comments
Hi @rocky05475. Thanks for your interest in the library! What exactly are you looking for this to do? Make the standard output stream pull from both? Or make both streams print to Console.Out of the invoking process? What should happen if both streams are outputting data simultaneously? Can you give some additional details, a code snippet of what the feature might look like, and an example use case? |
I want to do exactly what "2>&1" does in the command line prompt. Make the
standard output stream pull from both.
I wish it could be something like this:
Command.Run(...).RedirectStandardErrorToOutput();
בתאריך יום ו׳, 23 ביוני 2017 ב-15:00 מאת madelson <[email protected]
…:
Hi @rocky05475 <https://github.com/rocky05475>. Thanks for your interest
in the library!
What exactly are you looking for this to do? Make the standard output
stream pull from both? Or make both streams print to Console.Out of the
invoking process? What should happen if both streams are outputting data
simultaneously?
Can you give some additional details, a code snippet of what the feature
might look like, and an example use case?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#14 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AJAG1h6cNDzN_rhXgko_H0cS2g6tJecVks5sG6jQgaJpZM4ODNSa>
.
|
@rocky05475 one concern I have is that merging the streams on the .NET side means that the bytes could be arbitrarily interleaved due to concurrency issues. We could combine things at the text level to ensure that whole lines are preserved, but this would behave weirdly if the program were producing raw butes or not writing output in lines. Any thoughts on how this could be made to work? |
@rocky05475 I think a solution for this could be a new function
|
Nice.
Can you add it to the library?
בתאריך יום ג׳, 27 ביוני 2017 ב-13:30 מאת madelson <[email protected]
…:
@rocky05475 <https://github.com/rocky05475> I think a solution for this
could be a new function GetOutputAndErrorLines() which returns an
IEnumerable<string> of lines from both StandardOutput and StandardError.
You can then foreach this IEnumerable as the process is running:
foreach (var line in command.GetOutputAndErrorLines())
{
// do something with line
}
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#14 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AJAG1uNXW51NVB5sUJHM2YIb4q5y-hZ8ks5sINm8gaJpZM4ODNSa>
.
|
Working on it currently. I'm going to try and wrap a few of these suggested changes into a single new release version. |
Very useful feature.
The text was updated successfully, but these errors were encountered: