From a4bef84e375b090c1bc7e4221b8e0ee435dfcbba Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 15 Nov 2012 13:29:51 -0800 Subject: [PATCH] [util] Make hb-shape err if output-format is not understood And list supported formats. --- util/hb-shape.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/util/hb-shape.cc b/util/hb-shape.cc index ef926da..ca94152 100644 --- a/util/hb-shape.cc +++ b/util/hb-shape.cc @@ -45,6 +45,12 @@ struct output_buffer_t output_format = HB_BUFFER_SERIALIZE_FORMAT_TEXT; else output_format = hb_buffer_serialize_format_from_string (options.output_format, -1); + if (!hb_buffer_serialize_format_to_string (output_format)) + { + fail (false, "Unknown output format `%s'; supported formats are: %s", + options.output_format, + g_strjoinv (" / ", (gchar**) hb_buffer_serialize_list_formats ())); + } unsigned int flags = HB_BUFFER_SERIALIZE_FLAGS_DEFAULT; if (!format.show_glyph_names) -- 2.7.4