Merge pull request #86 from cpfair/hb-shape-output-help-improvement

Improve hb-shape/hb-view's help text w.r.t. output options
This commit is contained in:
Behdad Esfahbod 2015-04-13 23:40:35 -07:00
commit 76d5733111
1 changed files with 16 additions and 13 deletions

View File

@ -440,7 +440,7 @@ output_options_t::add_options (option_parser_t *parser)
const char *text; const char *text;
if (NULL == supported_formats) if (NULL == supported_formats)
text = "Set output format"; text = "Set output serialization format";
else else
{ {
char *items = g_strjoinv ("/", const_cast<char **> (supported_formats)); char *items = g_strjoinv ("/", const_cast<char **> (supported_formats));
@ -457,8 +457,8 @@ output_options_t::add_options (option_parser_t *parser)
}; };
parser->add_group (entries, parser->add_group (entries,
"output", "output",
"Output options:", "Output destination & format options:",
"Options controlling the output", "Options controlling the destination and form of the output",
this); this);
} }
@ -694,19 +694,22 @@ format_options_t::add_options (option_parser_t *parser)
{ {
GOptionEntry entries[] = 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}, {"show-text", 0, 0, G_OPTION_ARG_NONE, &this->show_text, "Prefix each line of output with its corresponding input text", NULL},
{"no-positions", 0, G_OPTION_FLAG_REVERSE, G_OPTION_ARG_NONE, &this->show_positions, "Do not show glyph positions", NULL}, {"show-unicode", 0, 0, G_OPTION_ARG_NONE, &this->show_unicode, "Prefix each line of output with its corresponding input codepoint(s)", NULL},
{"no-clusters", 0, G_OPTION_FLAG_REVERSE, G_OPTION_ARG_NONE, &this->show_clusters, "Do not show cluster mapping", 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},
{"show-text", 0, 0, G_OPTION_ARG_NONE, &this->show_text, "Show input text", 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},
{"show-unicode", 0, 0, G_OPTION_ARG_NONE, &this->show_unicode, "Show input Unicode codepoints", NULL}, {"no-glyph-names", 0, G_OPTION_FLAG_REVERSE, G_OPTION_ARG_NONE, &this->show_glyph_names, "Output glyph indices instead of names", NULL},
{"show-line-num", 0, 0, G_OPTION_ARG_NONE, &this->show_line_num, "Show line numbers", NULL}, {"no-positions", 0, G_OPTION_FLAG_REVERSE, G_OPTION_ARG_NONE, &this->show_positions, "Do not output glyph positions", NULL},
{"verbose", 0, G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK,(gpointer) &parse_verbose, "Show everything", NULL}, {"no-clusters", 0, G_OPTION_FLAG_REVERSE, G_OPTION_ARG_NONE, &this->show_clusters, "Do not output cluster indices", NULL},
{NULL} {NULL}
}; };
parser->add_group (entries, parser->add_group (entries,
"format", "output-syntax",
"Format options:", "Output syntax:\n"
"Options controlling the formatting of buffer contents", " text: [<glyph name or index>=<glyph cluster index within input>@<horizontal displacement>,<vertical displacement>+<horizontal advance>,<vertical advance>|...]\n"
" json: [{\"g\": <glyph name or index>, \"ax\": <horizontal advance>, \"ay\": <vertical advance>, \"dx\": <horizontal displacement>, \"dy\": <vertical displacement>, \"cl\": <glyph cluster index within input>}, ...]\n"
"\nOutput syntax options:",
"Options controlling the syntax of the output",
this); this);
} }