From 1d55ffeb66381889f11ebb9039ca4ec2ca5efbab Mon Sep 17 00:00:00 2001 From: Collin Fair Date: Sat, 14 Feb 2015 09:29:35 -0500 Subject: [PATCH 1/4] Add serialization syntax documentation. Clarify naming and wording in --help-output/--help-format --- util/options.cc | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/util/options.cc b/util/options.cc index 7387a5616..c5b619db1 100644 --- a/util/options.cc +++ b/util/options.cc @@ -440,11 +440,13 @@ output_options_t::add_options (option_parser_t *parser) const char *text; if (NULL == supported_formats) - text = "Set output format"; + text = "Set output serialization format"; else { char *items = g_strjoinv ("/", const_cast (supported_formats)); - text = g_strdup_printf ("Set output format\n\n Supported output formats are: %s", items); + text = g_strdup_printf ("Set output serialization format\n\n Supported output formats are: %s\n%s", items, + " text: [=@,+,|...]\n" + " json: [{\"g\": , \"ax\": , \"ay\": , \"dx\": , \"dy\": , \"cl\": }, ...]"); g_free (items); parser->free_later ((char *) text); } @@ -457,8 +459,8 @@ output_options_t::add_options (option_parser_t *parser) }; parser->add_group (entries, "output", - "Output options:", - "Options controlling the output", + "Output detination & format options (refer to --help-output-content for content options):", + "Options controlling the destination and form of the output", this); } @@ -694,19 +696,19 @@ format_options_t::add_options (option_parser_t *parser) { GOptionEntry entries[] = { - {"no-glyph-names", 0, G_OPTION_FLAG_REVERSE, G_OPTION_ARG_NONE, &this->show_glyph_names, "Use glyph indices instead of names", NULL}, - {"no-positions", 0, G_OPTION_FLAG_REVERSE, G_OPTION_ARG_NONE, &this->show_positions, "Do not show glyph positions", NULL}, - {"no-clusters", 0, G_OPTION_FLAG_REVERSE, G_OPTION_ARG_NONE, &this->show_clusters, "Do not show cluster mapping", NULL}, - {"show-text", 0, 0, G_OPTION_ARG_NONE, &this->show_text, "Show input text", NULL}, - {"show-unicode", 0, 0, G_OPTION_ARG_NONE, &this->show_unicode, "Show input Unicode codepoints", NULL}, - {"show-line-num", 0, 0, G_OPTION_ARG_NONE, &this->show_line_num, "Show line numbers", NULL}, - {"verbose", 0, G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK,(gpointer) &parse_verbose, "Show everything", NULL}, + {"show-text", 0, 0, G_OPTION_ARG_NONE, &this->show_text, "Prefix each line of output with its corresponding input text", NULL}, + {"show-unicode", 0, 0, G_OPTION_ARG_NONE, &this->show_unicode, "Prefix each line of output with its corresponding input codepoint(s)", NULL}, + {"show-line-num", 0, 0, G_OPTION_ARG_NONE, &this->show_line_num, "Prefix each line of output with its corresponding input line number", NULL}, + {"verbose", 0, G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, (gpointer) &parse_verbose, "Prefix each line of output with each of the above", NULL}, + {"no-glyph-names", 0, G_OPTION_FLAG_REVERSE, G_OPTION_ARG_NONE, &this->show_glyph_names, "Output glyph indices instead of names", NULL}, + {"no-positions", 0, G_OPTION_FLAG_REVERSE, G_OPTION_ARG_NONE, &this->show_positions, "Do not output glyph positions", NULL}, + {"no-clusters", 0, G_OPTION_FLAG_REVERSE, G_OPTION_ARG_NONE, &this->show_clusters, "Do not output cluster indices", NULL}, {NULL} }; parser->add_group (entries, - "format", - "Format options:", - "Options controlling the formatting of buffer contents", + "output-content", + "Output content options (refer to --help-output for output syntax):", + "Options controlling the content of the output", this); } From 9e867b64467c46eea5cc9b1d5a9404a1221bbbfc Mon Sep 17 00:00:00 2001 From: Collin Fair Date: Sat, 14 Feb 2015 09:32:04 -0500 Subject: [PATCH 2/4] Remove reference to --help-output-content in --help-output (as --help-output-format's options aren't available in hb-view) --- util/options.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/options.cc b/util/options.cc index c5b619db1..799ac4ff4 100644 --- a/util/options.cc +++ b/util/options.cc @@ -459,7 +459,7 @@ output_options_t::add_options (option_parser_t *parser) }; parser->add_group (entries, "output", - "Output detination & format options (refer to --help-output-content for content options):", + "Output detination & format options:", "Options controlling the destination and form of the output", this); } From 952b8dbdf61da9b4814e09ad3c1b9b76483bef5c Mon Sep 17 00:00:00 2001 From: Collin Fair Date: Sat, 14 Feb 2015 09:44:00 -0500 Subject: [PATCH 3/4] 'All' of the above, not 'each' --- util/options.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/options.cc b/util/options.cc index 799ac4ff4..fb74b1af1 100644 --- a/util/options.cc +++ b/util/options.cc @@ -699,10 +699,10 @@ format_options_t::add_options (option_parser_t *parser) {"show-text", 0, 0, G_OPTION_ARG_NONE, &this->show_text, "Prefix each line of output with its corresponding input text", NULL}, {"show-unicode", 0, 0, G_OPTION_ARG_NONE, &this->show_unicode, "Prefix each line of output with its corresponding input codepoint(s)", NULL}, {"show-line-num", 0, 0, G_OPTION_ARG_NONE, &this->show_line_num, "Prefix each line of output with its corresponding input line number", NULL}, - {"verbose", 0, G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, (gpointer) &parse_verbose, "Prefix each line of output with each of the above", NULL}, + {"verbose", 0, G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, (gpointer) &parse_verbose, "Prefix each line of output with all of the above", NULL}, {"no-glyph-names", 0, G_OPTION_FLAG_REVERSE, G_OPTION_ARG_NONE, &this->show_glyph_names, "Output glyph indices instead of names", NULL}, {"no-positions", 0, G_OPTION_FLAG_REVERSE, G_OPTION_ARG_NONE, &this->show_positions, "Do not output glyph positions", NULL}, - {"no-clusters", 0, G_OPTION_FLAG_REVERSE, G_OPTION_ARG_NONE, &this->show_clusters, "Do not output cluster indices", NULL}, + {"no-clusters", 0, G_OPTION_FLAG_REVERSE, G_OPTION_ARG_NONE, &this->show_clusters, "Do not output cluster indices", NULL}, {NULL} }; parser->add_group (entries, From 9ee176ee978e6668c4faf00028811ce70979122e Mon Sep 17 00:00:00 2001 From: Collin Fair Date: Sat, 14 Feb 2015 09:59:44 -0500 Subject: [PATCH 4/4] Stop hb-shape docs leaking into hb-view --- util/options.cc | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/util/options.cc b/util/options.cc index fb74b1af1..5d03caa69 100644 --- a/util/options.cc +++ b/util/options.cc @@ -444,9 +444,7 @@ output_options_t::add_options (option_parser_t *parser) else { char *items = g_strjoinv ("/", const_cast (supported_formats)); - text = g_strdup_printf ("Set output serialization format\n\n Supported output formats are: %s\n%s", items, - " text: [=@,+,|...]\n" - " json: [{\"g\": , \"ax\": , \"ay\": , \"dx\": , \"dy\": , \"cl\": }, ...]"); + text = g_strdup_printf ("Set output format\n\n Supported output formats are: %s", items); g_free (items); parser->free_later ((char *) text); } @@ -459,7 +457,7 @@ output_options_t::add_options (option_parser_t *parser) }; parser->add_group (entries, "output", - "Output detination & format options:", + "Output destination & format options:", "Options controlling the destination and form of the output", this); } @@ -706,9 +704,12 @@ format_options_t::add_options (option_parser_t *parser) {NULL} }; parser->add_group (entries, - "output-content", - "Output content options (refer to --help-output for output syntax):", - "Options controlling the content of the output", + "output-syntax", + "Output syntax:\n" + " text: [=@,+,|...]\n" + " json: [{\"g\": , \"ax\": , \"ay\": , \"dx\": , \"dy\": , \"cl\": }, ...]\n" + "\nOutput syntax options:", + "Options controlling the syntax of the output", this); }