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;
}
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=")) {
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;
}
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;
}
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;