From a5363e2f6c8e9b5c42be3686e46cb91ffd78735c Mon Sep 17 00:00:00 2001 From: triton Date: Fri, 16 Aug 2013 22:30:37 +0100 Subject: [PATCH] Added new quiet option in the driver that does not output unnecessary information. --- src/Generator/Driver.cs | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/src/Generator/Driver.cs b/src/Generator/Driver.cs index c293c054..6d553e09 100644 --- a/src/Generator/Driver.cs +++ b/src/Generator/Driver.cs @@ -225,6 +225,7 @@ namespace CppSharp // General options public bool Verbose; + public bool Quiet; public bool ShowHelpText; public bool OutputDebug; @@ -280,18 +281,26 @@ namespace CppSharp library.Setup(driver); driver.Setup(); - Console.WriteLine("Parsing libraries..."); + if (!options.Quiet) + Console.WriteLine("Parsing libraries..."); + if (!driver.ParseLibraries()) return; - Console.WriteLine("Indexing library symbols..."); + if (!options.Quiet) + Console.WriteLine("Indexing library symbols..."); + driver.LibrarySymbols.IndexSymbols(); - Console.WriteLine("Parsing code..."); + if (!options.Quiet) + Console.WriteLine("Parsing code..."); + if (!driver.ParseCode()) return; - Console.WriteLine("Processing code..."); + if (!options.Quiet) + Console.WriteLine("Processing code..."); + library.Preprocess(driver, driver.Library); driver.SetupPasses(library); @@ -299,7 +308,9 @@ namespace CppSharp driver.ProcessCode(); library.Postprocess(driver.Library); - Console.WriteLine("Generating code..."); + if (!options.Quiet) + Console.WriteLine("Generating code..."); + var outputs = driver.GenerateCode(); foreach (var output in outputs)