My application needs to:
- Run an external command-line application
- Capture the standard output/error during execution
- Parse the data from the output/error and use it for status display in the main app
While it's not hard to do it, it seems to me it's a very common task, and I was wondering if there's a library or framework simplifying this task in C#.
Edit: Here's a "Mono.Options inspired" example of the kind of thing I'm looking for:
ProcessWithParser proc= new ProcessWithParser(filename, arguments);
proc.AddWatch("percent=??", v => this.percent = Convert.ToInt32(v));
proc.Start();
In the "concept" above, it would locate "percent=" in the output, read the next two characters as a string, and call the delegate using this string as a parameter.