]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
add --quiet option to valac and vapigen, patch by Emmanuele Bassi, fixes
authorJuerg Billeter <j@bitron.ch>
Mon, 21 Jan 2008 17:27:16 +0000 (17:27 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Mon, 21 Jan 2008 17:27:16 +0000 (17:27 +0000)
2008-01-21  Juerg Billeter  <j@bitron.ch>

* 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

ChangeLog
compiler/valacompiler.vala
vapigen/valavapigen.vala

index 269c7c1aa93f88c3916a536d69601baa749c8ef0..ff45793522539c39635ed22e1d2e515c928bccc8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-01-21  Jürg Billeter  <j@bitron.ch>
+
+       * 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  <j@bitron.ch>
 
        * vala/valasemanticanalyzer.vala: improve generic type resolution, add
index d293165ed624efb64fac7caa8ca63bd4ad0968eb..039fadeb881f294df8a31446da41f37d2cee15d6 100644 (file)
@@ -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;
                }
        }
index c1fc55a4bfb67f788530debf8db3400f78ec7d8d..0ada9e77c4d2c7067935c2691c07bf61e01c6788 100644 (file)
@@ -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;
                }
        }