Exemplo n.º 1
0
 /// <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);
 }
Exemplo n.º 2
0
 public virtual Response PrependToError(string str, params object[] objects)
 {
     STDERR.Insert(0, string.Format(str, objects));
     return(this);
 }
Exemplo n.º 3
0
 public virtual Response AppendToError(string str, params object[] objects)
 {
     STDERR.Append(string.Format(str, objects));
     return(this);
 }