From a8b6bb97a86e61844e34a99d35a7c4b7e3f2ee05 Mon Sep 17 00:00:00 2001 From: William Hua Date: Tue, 25 Jun 2013 17:22:15 -0400 Subject: Tests work-in-progress. --- data/main.vala | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'data') diff --git a/data/main.vala b/data/main.vala index 862f88a1..e229ba3f 100644 --- a/data/main.vala +++ b/data/main.vala @@ -37,13 +37,11 @@ int main (string[] args) { context.set_help_enabled (true); context.parse (ref args); } catch (OptionError error) { - stderr.printf ("error: %s\n", error.message); - return 1; + GLib.error ("error: %s", error.message); } if (no_subscript_path == null && with_subscript_path == null) { - stderr.printf ("error: No icon template\n"); - return 2; + error ("error: No icon template"); } else if (no_subscript_path == null) { no_subscript_path = with_subscript_path; } else if (with_subscript_path == null) { @@ -57,8 +55,7 @@ int main (string[] args) { try { file.make_directory_with_parents (null); } catch (Error error) { - stderr.printf ("error: %s\n", error.message); - return 3; + GLib.error ("error: %s", error.message); } } } else { @@ -126,8 +123,7 @@ int main (string[] args) { with_subscript_data = with_subscript_data.replace ("@LAYOUT_FONT@", layout_font); with_subscript_data = with_subscript_data.replace ("@SUBSCRIPT_FONT@", subscript_font); } catch (Error error) { - stderr.printf ("error: %s\n", error.message); - return 4; + GLib.error ("error: %s", error.message); } var font_map = new PangoFT2.FontMap (); @@ -173,7 +169,7 @@ int main (string[] args) { try { file.replace_contents (output_data.data, null, false, FileCreateFlags.REPLACE_DESTINATION, null, null); } catch (Error error) { - stderr.printf ("error: %s\n", error.message); + GLib.error ("error: %s", error.message); } } @@ -217,7 +213,7 @@ int main (string[] args) { try { file.replace_contents (output_data.data, null, false, FileCreateFlags.REPLACE_DESTINATION, null, null); } catch (Error error) { - stderr.printf ("error: %s\n", error.message); + GLib.error ("error: %s", error.message); } } } -- cgit v1.2.3