diff --git a/src/Generator/Driver.cs b/src/Generator/Driver.cs
index 0dca66ab..531432e1 100644
--- a/src/Generator/Driver.cs
+++ b/src/Generator/Driver.cs
@@ -470,7 +470,9 @@ namespace CppSharp
}
}
- driver.WriteCode(outputs);
+ if (!driver.Options.DryRun)
+ driver.WriteCode(outputs);
+
if (driver.Options.IsCSharpGenerator)
driver.CompileCode();
}
diff --git a/src/Generator/Options.cs b/src/Generator/Options.cs
index 68dda98d..deec8d7d 100644
--- a/src/Generator/Options.cs
+++ b/src/Generator/Options.cs
@@ -54,7 +54,15 @@ namespace CppSharp
// General options
public bool Quiet;
public bool ShowHelpText;
- public bool OutputDebug;
+ public bool OutputDebug;
+
+ ///
+ /// Set to true to simulate generating without actually writing
+ /// any output to disk. This can be useful to activate while
+ /// debugging the parser generator so generator bugs do not get
+ /// in the way while iterating.
+ ///
+ public bool DryRun;
// Parser options
public List Headers;