[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Libguestfs] [PATCH 4/4] ocaml tools: Only tell people to use -v -x if they're not already set (RHBZ#1167623).



When you get an error in tools, it will print a message like:

  If reporting bugs, run virt-v2v with debugging enabled and include the
  complete output:

    virt-v2v -v -x [...]

Only print this message if -v or -x were not already specified on the
command line.
---
 mllib/common_utils.ml | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/mllib/common_utils.ml b/mllib/common_utils.ml
index 071cb1e..13c5596 100644
--- a/mllib/common_utils.ml
+++ b/mllib/common_utils.ml
@@ -297,11 +297,13 @@ let error ?(exit_code = 1) fs =
     let chan = stderr in
     ansi_red ~chan ();
     wrap ~chan (sprintf (f_"%s: error: %s") prog str);
-    prerr_newline ();
-    prerr_newline ();
-    wrap ~chan
-      (sprintf (f_"If reporting bugs, run %s with debugging enabled and include the complete output:\n\n  %s -v -x [...]")
-         prog prog);
+    if not (verbose () && trace ()) then (
+      prerr_newline ();
+      prerr_newline ();
+      wrap ~chan
+           (sprintf (f_"If reporting bugs, run %s with debugging enabled and include the complete output:\n\n  %s -v -x [...]")
+                    prog prog);
+    );
     ansi_restore ~chan ();
     prerr_newline ();
     exit exit_code
-- 
2.3.1


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]