From: <sl...@ke...> - 2009-05-30 11:49:58
|
Module: gstreamer-sharp Branch: master Commit: 2ed4e4dd98b17ca2ca76e9e8499a27872013f700 URL: http://cgit.freedesktop.org/gstreamer/gstreamer-sharp/commit/?id=2ed4e4dd98b17ca2ca76e9e8499a27872013f700 Author: Maarten Bosmans <mkb...@gm...> Date: Sat May 30 13:42:05 2009 +0200 Write error messages to stderr and fix a compiler warning Fixes bug #584209. --- elementgen/elementgen.cs | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/elementgen/elementgen.cs b/elementgen/elementgen.cs index cdc9565..d3e6139 100644 --- a/elementgen/elementgen.cs +++ b/elementgen/elementgen.cs @@ -469,7 +469,7 @@ public class ElementGen { public static int Main (string[] args) { if (args.Length != 3) { - Console.WriteLine ("Usage: element-gen --namespace=<namespace> --api=<api> --input=<in-filename>"); + Console.Error.WriteLine ("Usage: element-gen --namespace=<namespace> --api=<api> --input=<in-filename>"); return -1; } @@ -488,7 +488,7 @@ public class ElementGen { introspect_doc.Load (stream); stream.Close (); } catch (Exception e) { - Console.WriteLine ("Failed to load introspection XML:\n" + e.ToString ()); + Console.Error.WriteLine ("Failed to load introspection XML:\n" + e.ToString ()); return -2; } } else if (arg.StartsWith ("--api=")) { @@ -500,7 +500,7 @@ public class ElementGen { api_doc.Load (stream); stream.Close (); } catch (Exception e) { - Console.WriteLine ("Failed to load API XML:\n" + e.ToString ()); + Console.Error.WriteLine ("Failed to load API XML:\n" + e.ToString ()); return 1; } @@ -508,13 +508,13 @@ public class ElementGen { ns = arg.Substring (12); } else { - Console.WriteLine ("Usage: element-gen --namespace:<namespace> --api=<api> --input:<in-filename>"); + Console.Error.WriteLine ("Usage: element-gen --namespace:<namespace> --api=<api> --input:<in-filename>"); return 1; } } if (introspect_doc.DocumentElement.Name != "element") { - Console.WriteLine ("Invalid introspection XML"); + Console.Error.WriteLine ("Invalid introspection XML"); return -3; } @@ -523,14 +523,14 @@ public class ElementGen { try { writer = Console.Out; } catch (Exception e) { - Console.WriteLine ("Failed to open output file:\n" + e.ToString ()); + Console.Error.WriteLine ("Failed to open output file:\n" + e.ToString ()); return -2; } StreamReader custom_code = null; try { custom_code = System.IO.File.OpenText (filename + ".custom"); - } catch (Exception e) {} + } catch (Exception) {} // No custom file is OK if (IsHidden (introspect_doc.DocumentElement)) return 0; |