[pango] pango-list: Add a --verbose option
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pango] pango-list: Add a --verbose option
- Date: Tue, 16 Jul 2019 19:58:57 +0000 (UTC)
commit d3a9da00a66565ac14e971d96aeeb9a143ef5368
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Jul 16 15:57:46 2019 -0400
pango-list: Add a --verbose option
utils/pango-list.c | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
---
diff --git a/utils/pango-list.c b/utils/pango-list.c
index 642b09fc..6c6274fe 100644
--- a/utils/pango-list.c
+++ b/utils/pango-list.c
@@ -28,16 +28,39 @@ int
main (int argc,
char **argv)
{
+ gboolean opt_verbose = FALSE;
+ GOptionEntry entries[] = {
+ {"verbose", 0, 0, G_OPTION_ARG_NONE, &opt_verbose, "Print verbose information", NULL },
+ { NULL, }
+ };
+ GOptionContext *context;
PangoFontMap *fontmap;
PangoFontFamily **families;
int n_families;
int i, j, k;
+ GError *error = NULL;
g_set_prgname ("pango-list");
+ context = g_option_context_new ("");
+ g_option_context_add_main_entries (context, entries, NULL);
+ if (!g_option_context_parse (context, &argc, &argv, &error))
+ {
+ if (error != NULL)
+ g_error ("%s", error->message);
+ else
+ g_error ("Option parse error");
+ exit (1);
+ }
+
+ g_option_context_free (context);
+
/* Use PangoCairo to get default fontmap so it works on every platform. */
fontmap = pango_cairo_font_map_get_default ();
+ if (opt_verbose)
+ g_print ("Using %s\n\n", G_OBJECT_TYPE_NAME (fontmap));
+
pango_font_map_list_families (fontmap, &families, &n_families);
for (i = 0; i < n_families; i++)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]