[util] Default to "text" output format in hb-shape
If you say:
hb-shape font.ttf text --output-file out.txt
This was previously failing:
Unknown output format `txt'; supported formats are: TEXT / JSON
Now we simply fallback to TEXT if no explicit format was requested.
diff --git a/util/options.hh b/util/options.hh
index 093f052..c664731 100644
--- a/util/options.hh
+++ b/util/options.hh
@@ -313,6 +313,7 @@
output_options_t (option_parser_t *parser) {
output_file = NULL;
output_format = NULL;
+ explicit_output_format = false;
fp = NULL;
@@ -327,6 +328,9 @@
void post_parse (GError **error G_GNUC_UNUSED)
{
+ if (output_format)
+ explicit_output_format = true;
+
if (output_file && !output_format) {
output_format = strrchr (output_file, '.');
if (output_format)
@@ -341,6 +345,7 @@
const char *output_file;
const char *output_format;
+ bool explicit_output_format;
mutable FILE *fp;
};