/// <summary>Actually executes this Response, writing to Console.Out, Console.Error, and exiting the process using the ExitCode</summary> /// <remarks> /// You can call response.Execute(false) and we'll return the ExitCode instead of actually exiting the current process. /// </remarks> public virtual int Execute(bool exit) { if (STDOUT.Length > 0) { Console.Out.Write(STDOUT.ToString()); } if (STDERR.Length > 0) { Console.Error.Write(STDERR.ToString()); } if (exit) { Environment.Exit(ExitCode); } return(ExitCode); }
public virtual Response PrependToError(string str, params object[] objects) { STDERR.Insert(0, string.Format(str, objects)); return(this); }
public virtual Response AppendToError(string str, params object[] objects) { STDERR.Append(string.Format(str, objects)); return(this); }