Forum Navigation
Process use cases?
Posted: 11/20/08 15:30:19I'm adding yet another option to tango.sys.Process that allows for specifying redirection of stdout/stderr/stdin. This allows one to only redirect one or two of those handles, and leave the rest to point to the current stdout/err/in.
What I'm realizing is that as I add new orthogonal features to Process, the constructors are multiplying. In addition, the execute function pretty much duplicates all the same arguments as the constructor.
What I'm wondering is if people actually use the arguments to execute, or if they just use the constructor and properties to set up the process, and then call execute with no arguments? It would make my job much easier if there was only one execute function.
Or, alternatively, would it make sense to allow uncommon options (such as specifying redirection) to only be settable through properties, and then use call chaining to do it all in one line, without having 2n different functions?
auto p = new Process("ls"); p.setRedirection(Redirect.Stdout).execute();Thoughts? Suggestions?