[vala] Add --verbose command-line option
- From: Jürg Billeter <juergbi src gnome org>
- To: svn-commits-list gnome org
- Subject: [vala] Add --verbose command-line option
- Date: Tue, 14 Apr 2009 13:41:18 -0400 (EDT)
commit dbe3624431a5e086668c26e763c569883f83ba08
Author: Jürg Billeter <j bitron ch>
Date: Tue Apr 14 19:39:55 2009 +0200
Add --verbose command-line option
Currently just prints C compiler command-line before execution.
Fixes bug 559890.
---
compiler/valacompiler.vala | 3 +++
gobject/valaccodecompiler.vala | 4 ++++
vala/valacodecontext.vala | 2 ++
3 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/compiler/valacompiler.vala b/compiler/valacompiler.vala
index f1e1cb0..1e4ac9b 100644
--- a/compiler/valacompiler.vala
+++ b/compiler/valacompiler.vala
@@ -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;
diff --git a/gobject/valaccodecompiler.vala b/gobject/valaccodecompiler.vala
index c5696e6..31e395a 100644
--- a/gobject/valaccodecompiler.vala
+++ b/gobject/valaccodecompiler.vala
@@ -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) {
diff --git a/vala/valacodecontext.vala b/vala/valacodecontext.vala
index ef66dd2..460874f 100644
--- a/vala/valacodecontext.vala
+++ b/vala/valacodecontext.vala
@@ -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.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]