From: Juerg Billeter Date: Mon, 21 Jan 2008 17:27:16 +0000 (+0000) Subject: add --quiet option to valac and vapigen, patch by Emmanuele Bassi, fixes X-Git-Tag: VALA_0_1_7~216 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c8a97ec073e10864d188c9b7bf768f0952ac1902;p=thirdparty%2Fvala.git add --quiet option to valac and vapigen, patch by Emmanuele Bassi, fixes 2008-01-21 Juerg Billeter * compiler/valacompiler.vala, vapigen/valavapigen.vala: add --quiet option to valac and vapigen, patch by Emmanuele Bassi, fixes bug 510998 svn path=/trunk/; revision=875 --- diff --git a/ChangeLog b/ChangeLog index 269c7c1aa..ff4579352 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-01-21 Jürg Billeter + + * compiler/valacompiler.vala, vapigen/valavapigen.vala: add --quiet + option to valac and vapigen, + patch by Emmanuele Bassi, fixes bug 510998 + 2008-01-21 Jürg Billeter * vala/valasemanticanalyzer.vala: improve generic type resolution, add diff --git a/compiler/valacompiler.vala b/compiler/valacompiler.vala index d293165ed..039fadeb8 100644 --- a/compiler/valacompiler.vala +++ b/compiler/valacompiler.vala @@ -50,6 +50,7 @@ class Vala.Compiler : Object { static bool save_temps; [NoArrayLength] static string[] defines; + static bool quiet_mode; private CodeContext context; @@ -73,16 +74,21 @@ class Vala.Compiler : Object { { "cc", 0, 0, OptionArg.STRING, out cc_command, "Use COMMAND as C compiler command", "COMMAND" }, { "Xcc", 'X', 0, OptionArg.STRING_ARRAY, out cc_options, "Pass OPTION to the C compiler", "OPTION..." }, { "save-temps", 0, 0, OptionArg.NONE, out save_temps, "Keep temporary files", null }, + { "quiet", 'q', 0, OptionArg.NONE, ref quiet_mode, "Do not print messages to the console", null }, { "", 0, 0, OptionArg.FILENAME_ARRAY, out sources, null, "FILE..." }, { null } }; private int quit () { if (Report.get_errors () == 0) { - stdout.printf ("Compilation succeeded - %d warning(s)\n", Report.get_warnings ()); + if (!quiet_mode) { + stdout.printf ("Compilation succeeded - %d warning(s)\n", Report.get_warnings ()); + } return 0; } else { - stdout.printf ("Compilation failed: %d error(s), %d warning(s)\n", Report.get_errors (), Report.get_warnings ()); + if (!quiet_mode) { + stdout.printf ("Compilation failed: %d error(s), %d warning(s)\n", Report.get_errors (), Report.get_warnings ()); + } return 1; } } diff --git a/vapigen/valavapigen.vala b/vapigen/valavapigen.vala index c1fc55a4b..0ada9e77c 100644 --- a/vapigen/valavapigen.vala +++ b/vapigen/valavapigen.vala @@ -25,6 +25,7 @@ using GLib; class Vala.VAPIGen : Object { static string directory; static bool version; + static bool quiet_mode; [NoArrayLength ()] static string[] sources; [NoArrayLength ()] @@ -40,16 +41,21 @@ class Vala.VAPIGen : Object { { "library", 0, 0, OptionArg.STRING, out library, "Library name", "NAME" }, { "directory", 'd', 0, OptionArg.FILENAME, out directory, "Output directory", "DIRECTORY" }, { "version", 0, 0, OptionArg.NONE, ref version, "Display version number", null }, + { "quiet", 'q', 0, OptionArg.NONE, ref quiet_mode, "Do not print messages to the console", null }, { "", 0, 0, OptionArg.FILENAME_ARRAY, out sources, null, "FILE..." }, { null } }; private int quit () { if (Report.get_errors () == 0) { - stdout.printf ("Generation succeeded - %d warning(s)\n", Report.get_warnings ()); + if (!quiet_mode) { + stdout.printf ("Generation succeeded - %d warning(s)\n", Report.get_warnings ()); + } return 0; } else { - stdout.printf ("Generation failed: %d error(s), %d warning(s)\n", Report.get_errors (), Report.get_warnings ()); + if (!quiet_mode) { + stdout.printf ("Generation failed: %d error(s), %d warning(s)\n", Report.get_errors (), Report.get_warnings ()); + } return 1; } }