Esempio n. 1
0
 /// <summary>
 /// Initializes a new instance of a FormatterVisitor.
 /// </summary>
 /// <param name="writer">The text writer to write the text to.</param>
 /// <param name="options">The command options to use to augment the text generation.</param>
 public FormattingVisitor(TextWriter writer, CommandOptions options = null)
 {
     if (writer == null)
     {
         throw new ArgumentNullException("writer");
     }
     this.writer              = writer;
     this.options             = options == null ? new CommandOptions() : options.Clone();
     this.commandType         = CommandType.Unknown;
     this.sourceReferenceType = SourceReferenceType.Declaration;
     this.valueReferenceType  = ValueReferenceType.Declaration;
 }
Esempio n. 2
0
 /// <summary>
 /// Run 'commandLine', sending the output to the console, and wait for the Command to complete.
 /// This simulates what batch filedo when executing their commands.  It is a bit more verbose
 /// by default, however
 /// </summary>
 /// <param variable="commandLine">The Command lineNumber to run as a subprocess</param>
 /// <param variable="options">Additional qualifiers that control how the process is run</param>
 /// <returns>A Command structure that can be queried to determine ExitCode, Output, etc.</returns>
 public static Command RunToConsole(string commandLine, CommandOptions options)
 {
     return(Run(commandLine, options.Clone().AddOutputStream(Console.Out).AddErrorStream(Console.Error)));
 }