summaryrefslogtreecommitdiff
path: root/valadoc
diff options
context:
space:
mode:
authorJiří Janoušek <janousek.jiri@gmail.com>2018-11-25 15:00:34 +0100
committerRico Tzschichholz <ricotz@ubuntu.com>2018-11-25 17:25:48 +0100
commitb0c0a0ee097ed8968f77cf7b1548e916b7acd8d8 (patch)
tree3dca388be0f428e1e5d1248f4b82f57bd26ab27b /valadoc
parent1383ab9f78f81b4ef56d63b38df702253ac8469b (diff)
downloadvala-b0c0a0ee097ed8968f77cf7b1548e916b7acd8d8.tar.gz
valadoc: Add --fatal-warnings command line option
To be able to treat warnings as fatal.
Diffstat (limited to 'valadoc')
-rw-r--r--valadoc/valadoc.vala4
1 files changed, 3 insertions, 1 deletions
diff --git a/valadoc/valadoc.vala b/valadoc/valadoc.vala
index 7e74a187b..d05da55d6 100644
--- a/valadoc/valadoc.vala
+++ b/valadoc/valadoc.vala
@@ -49,6 +49,7 @@ public class ValaDoc : Object {
private static bool disable_diagnostic_colors = false;
private static bool verbose = false;
private static bool force = false;
+ private static bool fatal_warnings = false;
private static string basedir = null;
[CCode (array_length = false, array_null_terminated = true)]
@@ -114,6 +115,7 @@ public class ValaDoc : Object {
{ "version", 0, 0, OptionArg.NONE, ref version, "Display version number", null },
{ "force", 0, 0, OptionArg.NONE, ref force, "force", null },
+ { "fatal-warnings", 0, 0, OptionArg.NONE, ref fatal_warnings, "Treat warnings as fatal", null },
{ "verbose", 0, 0, OptionArg.NONE, ref verbose, "Show all warnings", null },
{ "no-color", 0, 0, OptionArg.NONE, ref disable_diagnostic_colors, "Disable colored output", null },
{ "target-glib", 0, 0, OptionArg.STRING, ref target_glib, "Target version of glib for code generation", "MAJOR.MINOR" },
@@ -123,7 +125,7 @@ public class ValaDoc : Object {
};
private static int quit (ErrorReporter reporter) {
- if (reporter.errors == 0) {
+ if (reporter.errors == 0 && (!fatal_warnings || reporter.warnings == 0)) {
stdout.printf ("Succeeded - %d warning(s)\n", reporter.warnings);
return 0;
} else {