]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Add --verbose command-line option
authorJürg Billeter <j@bitron.ch>
Tue, 14 Apr 2009 17:39:55 +0000 (19:39 +0200)
committerJürg Billeter <j@bitron.ch>
Tue, 14 Apr 2009 17:39:55 +0000 (19:39 +0200)
Currently just prints C compiler command-line before execution.
Fixes bug 559890.

compiler/valacompiler.vala
gobject/valaccodecompiler.vala
vala/valacodecontext.vala

index f1e1cb080119cfe96fc79b8855d38a5bb1e8c20d..1e4ac9b603cfcf838549b279ebba6b1d283d8f87 100644 (file)
@@ -63,6 +63,7 @@ class Vala.Compiler {
        [NoArrayLength]
        static string[] defines;
        static bool quiet_mode;
+       static bool verbose_mode;
 
        private CodeContext context;
 
@@ -93,6 +94,7 @@ class Vala.Compiler {
                { "dump-tree", 0, 0, OptionArg.FILENAME, ref dump_tree, "Write code tree to FILE", "FILE" },
                { "save-temps", 0, 0, OptionArg.NONE, ref save_temps, "Keep temporary files", null },
                { "quiet", 'q', 0, OptionArg.NONE, ref quiet_mode, "Do not print messages to the console", null },
+               { "verbose", 'v', 0, OptionArg.NONE, ref verbose_mode, "Print additional messages to the console", null },
                { "target-glib", 0, 0, OptionArg.STRING, ref target_glib, "Target version of glib for code generation", "MAJOR.MINOR" },
                { "", 0, 0, OptionArg.FILENAME_ARRAY, ref sources, null, "FILE..." },
                { null }
@@ -174,6 +176,7 @@ class Vala.Compiler {
                context.non_null_experimental = non_null_experimental;
                context.dbus_transformation = !disable_dbus_transformation;
                context.report.set_verbose_errors (!quiet_mode);
+               context.verbose_mode = verbose_mode;
 
                context.ccode_only = ccode_only;
                context.compile_only = compile_only;
index c5696e67d45436550ec53757c3b1bb3502811c13..31e395a7a22c7c0be69eb50b67d30054c3de7ebd 100644 (file)
@@ -113,6 +113,10 @@ public class Vala.CCodeCompiler {
                        cmdline += " " + Shell.quote (cc_option);
                }
 
+               if (context.verbose_mode) {
+                       stdout.printf ("%s\n", cmdline);
+               }
+
                try {
                        Process.spawn_command_line_sync (cmdline, null, null, out exit_status);
                        if (exit_status != 0) {
index ef66dd28301af11f502cc4cf147fcfd8623bb127..460874f615e7fecfdaba40426665cfb352f71bca 100644 (file)
@@ -140,6 +140,8 @@ public class Vala.CodeContext {
         */
        public int target_glib_minor { get; set; }
 
+       public bool verbose_mode { get; set; }
+
        /**
         * Returns true if the target version of glib is greater than or 
         * equal to the specified version.